Posts: 1035
Joined: Mon Feb 04, 2008 8:05 pm
Location: Thailand
Contact: Website

change of default sort

Mon Mar 31, 2008 2:49 pm

in vehicletracker is the default sort not defined.

well i simply move the collums to match my criteria ..
but the sorting is not happening.

any ideas how to "manage" the default sort criteria in the vehiclelist ?

Backups are for WIMPS!

User avatar
Posts: 1158
Joined: Fri Mar 02, 2007 1:04 pm
Location: Sweden
Contact: Website

RE: change of default sort

Mon Mar 31, 2008 3:11 pm

The tablecontrol is initialized using the registerColumns method. It takes an array of column specifications (left to right). Each column can have a custom compare function associated with it, simply replace/modify this with the compare function you need. Compare functions take two params and return -1, 0 or +1 for less than, equal, and greater than respectively. See for example GateUser.js compareUsernameNoCase. The initial column to sort on is specified with TableControl::m_currColSortIndex.


Franson Support

Return to “GpsGate Server - How to setup and use”