Derrell,
I looked at the code for the table model and it looks plausable to capture
the event qx.ui.table.ITableModel.EVENT_TYPE_META_DATA_CHANGED.  However,
Fabians suggestion works perfectly and really is a better solution for me. 
It allows me to capture the sort column number and the sort direction any
time either changes.  Thanks to both of you.  Here is my entire code that
subclasses the table model.

//
*****************************************************************************
// *                                                        
grfind.MyTableModel                                                   *
//
*****************************************************************************
qx.Class.define("grfind.MyTableModel",
{
    extend : qx.ui.table.model.Simple,
     
//***********************************************************************
      //                                                     CONSTRUCTION       
                                            
*
     
//***********************************************************************
    construct : function()
    {
      this.base(arguments);
      var app = this.app = arguments[0]['app'];
    },
 /*
 
*****************************************************************************
     PROPERTIES
 
*****************************************************************************
  */
  properties :
  {
    sortIndex :
    {
      init : [-1,null],             // [ integer - sortIndex , boolean - if
sort is ascending ]
      event : "changeSortIndex"
    }
  },
   
//**************************************************************************
    //                                                          MEMBERS         
                                                   
*
   
//**************************************************************************
    members :
    {
        //
        // sortByColumn
        //
            sortByColumn : function(columnIndex, ascending) {
                this.base(arguments, columnIndex, ascending);
                this.setSortIndex([columnIndex, ascending]);
            }
     }
});
// EOF



Fabian Jakobs-2 wrote:
> 
> Hi Tom,
>> I have a table that uses the simple table model.  Is there an event that
>> is
>> triggered when there is a change in the column that is sorted?  I am
>> looking
>> for something like
>>
>>                 table.getTableModel().addListener("changeInSortColumn",
>> function(e) {
>>                     var newSortColumn = e.getTarget().getNewColumn();
>>                 });
>>
>> How can I tell when the user clicks on a table header and changes the
>> column
>> that is currently sorted?
>>   
> We don't have such an event. To get a notification you could subclass 
> the table model you use and override the "sortByColumn" method.
> 
> e.g.
> 
> sortByColumn : function(columnIndex, ascending) {
>     this.base(arguments, columnIndex, ascending);
>    
>     doStuffOnSortOrderChange();
> }
> 
> 
> We have an open bug for this issue 
> <http://bugzilla.qooxdoo.org/show_bug.cgi?id=1119> but its unassigned 
> and has no target milestone, which means that we don't plan to implement 
> it soon.  Feel free to grab this bug and submit a patch for it.
> 
> Best Fabian
> 
> -- 
> Fabian Jakobs
> JavaScript Framework Developer
> 
> 1&1 Internet AG - Web Technologies
> Ernst-Frey-Straße 9 · DE-76135 Karlsruhe
> Telefon: +49 721 91374-6784
> [email protected]
> 
> Amtsgericht Montabaur / HRB 6484
> Vorstände: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas
> Gottschlich, Robert Hoffmann, Markus Huhn, Hans-Henning Kettler, Dr.
> Oliver Mauss, Jan Oetjen
> Aufsichtsratsvorsitzender: Michael Scheeren
> 
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Table-Sort-Order-tp22737291p22746196.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to