Class: Column


Summary

A single column used within multi-column lists.


Remarks

You can add new columns into DigiGuide programme lists (single channel, finder etc.)

Adding a column is fairly easy;

StepDescription
var c = new Column ...
Create a new Column.
c.onDraw = function ...
Add event functions.
app.getColumnManager().addColumn( knColumnTypeProgrammes, c );
Add the new column to the column manager.

See Column.id information about choosing a column ID.


Methods

MethodDescription
 Constructor Create a new column


Events

EventDescription
 onCompareItems Compare two items and return their relative sort order
 onDraw Called when the column needs to draw it's content
 onGetWidth Called when DigiGuide needs the ideal width of the column


Properties

PropertyDescription
 canSize Specifies if the column can be sized using the divider line
 canSort Specifies if the column can be sorted
 defaultWidth The default width of the column when shown for the first time
 description The description of the column.
 id [read only] The internal ID of the column
 minimumWidth The minimum width that the column can be sized down to
 name The name of the column.


Examples

var cm = app.getColumnManager();

// name, ID, minimumWidth, defaultWidth, canSort, canSize, description
var c = new Column( "Channel Name", 1, 25, 50, true, true, "Full channel name" )

c.onDraw = function ( dc, rc, textColour, programme )
{
dc.drawEllipsisText( rc.left, rc.top, rc.right, programme.channel.name, textColour );
}

c.onGetWidth = function( dc, programme )
{
return dc.measureText( programme.channel.name ).cx;
}

c.onCompareItems = function( programmeLeft, programmeRight )
{
if( programmeLeft.channel.name > programmeRight.channel.name )
{
return 1;
}
else if( programmeLeft.channel.name < programmeRight.channel.name )
{
return -1;
}
return 0;
}


cm.addColumn( knColumnTypeProgrammes, c );


See Also

  • ColumnManager : addColumn
  • ColumnManager : getColumnFromID


    Requirements

    1065