On Sat, Aug 22, 2009 at 09:44, skar <[email protected]> wrote:
> Derrell Lipman wrote:
> > I just implemented and commited to trunk (r19880) a new event, "sorted",
> > which is fired on the TableModel object immediately after the table model
> is
> > sorted, but before the "metaDataChanged" event is fired. The event
> provides
> > data to the listener which is a map containing the column id just sorted
> on,
> > and a boolean indicating whether it was sorted in ascending or descending
> > order. Usage is demonstrated in the demobrowser demo "Table_Events".
> >
> Thanks, it works. Also, I found that the event data has redundant data
> regarding the sort column index and sort order like below:
>
> > __sortColumnIndex:0,__sortAscending:true}, __data:{columnIndex:0,
> > ascending:true},
> Can I use either the (__sortColumnIndex, __sortAscending) pair or the
> __data ? Is any of the pair unofficial, liable to be removed/changed in
> the future?
>
You can not depend on anything that begins with two underscores. Those are
private members. When you create the "build" version of your application,
they will change names and, I think, errors generated if you try to
reference them.
The official and proper way to access the data provided in a Data event is
to call e.getData(). In this case, that will return a map containing the
two members "columnIndex" and "ascending". The fact that it happens to be
called __data within the event object is irrelevant, could change at any
time, and you should not depend on that. Only access the data via its getter
method, getData().
This applies throughout qooxdoo, not just here. Don't attempt to access
private members. Ever. They're none of your business; that's why they're
called "private". :-)
Cheers,
Derrell
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel