It took a while to figure out my sorting problem (the good news is I am
diving into source code and finding my problems).

Ideally, the sortByColumn functionality in Remote.js is enough to fire the
_loadRowData() function.
I think it is dispatching a wrong event.

I had to override that method to fire right event in MyRemoteTable.class as
// overridden
sortByColumn : function(columnIndex, ascending)
{
   if (this._sortColumnIndex != columnIndex || this._sortAscending !=
ascending)
  {
      this._sortColumnIndex = columnIndex;
      this._sortAscending = ascending;
                
      this.clearCache();
                
   // Inform the listeners
    
this.createDispatchEvent(qx.ui.table.ITableModel.EVENT_TYPE_META_DATA_CHANGED);
  }
}

It should fire EVENT_TYPE_META_DATA_CHANGED instead of
EVENT_TYPE_DATA_CHANGED. Can somebody fix the code please?

Thanks.
Kanugula.




kanugula wrote:
> 
> Thank you Derell.
> I was about to anounce my mistake. I just saw your reply. Thank you. 
> 
> I put my overriding method in wrong class. My apologies. 
> 
> I am calling tableModel.setColumnSortable(columnIndex, true). 
> 
> I will post my results(good or bad) in my next post.
> 
> Thank you.
> Kanugula.
> 
> 
> Derrell Lipman wrote:
>> 
>> On Feb 1, 2008 10:04 PM, kanugula <[EMAIL PROTECTED]> wrote:
>>>
>>> Thanks for  your reply.
>>>
>>> I have overriden that method. But my overriding method is not called at
>>> all.
>>> Is there any way to implement polymorphism without directly changing the
>>> sdk
>>> code in Remote.js.
>>>
>>> My overriding method in MyRemoteTable.js
>>>
>>> sortByColumn : function(columnIndex, ascending)
>>>     {
>>>       alert("This method is called");
>>>
>>>       this.base(arguements);
>>>
>>>       //Call to my Backend follows here
>>>
>>>     }
>>>
>>> Do you know how to override that method?
>> 
>> Hmmm...  Looking at the code, it seems that the Remote table model
>> does attempt to provide the ability to help you sort by a particular
>> column.  It does, however, require that you have set the appropriate
>> column to be sortable by calling
>> tableModel.setColumnSortable(columnIndex, true).  Have you done that?
>> 
>> Also, when sortByColuimn() is called, it flushes the cache and
>> dispatches a META DATA CHANGED event.  Without actually altering the
>> code in the Remote class at all, you could listen on that event and
>> issue a command to the backend to change the sort order on future
>> requests.  Since the cache has been flushed, it's going to have to
>> make new calls to the backend to retrieve data to be displayed, and
>> that data can be returned in the order that you told it to use during
>> the META DATA CHANGED event handler.
>> 
>> Hope that helps.
>> 
>> Derrell
>> 
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Remote-Table-sorting-doesn%27t-work-tp15234469p15298560.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to