Class Column : onCompareItems Event


Integer onCompareItems( Programme programmeLeft, Programme programmeRight )

Summary

Compare two items and return their relative sort order


Remarks

Called when DigiGuide needs to compare two items. Normally this is called either when new items are being added to a list or when the user sorts columns.

DigiGuide automaticallys selects the correct font so there is no need to select a font, but you are free to use whatever font you want.


Parameters

ParameterDescription
Programme programmeLeft
Programme programmeRight


Returns

The result of the comparison
return 0 if the items are the same

return -1 if programmeLeft is "less than" programmeRight

return 1 if programmeLeft is "greater than" programmeRight


Examples

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


See Also

  • Column : canSort


    Requirements

    build 1065