List_SortColumn and Editable Table

  
When create a table by scafoldding, the list_sortcolumn works as usual. When the list table is replaced with an editable table, the list_sortcolumn does not change the orderby property to the underlying aggregate. How to sort an editable table properly?

Thanks,
Stanley
Solution
Hi Stanley,

I don't think list_sortcolumn works with the editabletable widget, but you can put links in the header that change the sort field using a dynamic order by in the source aggregate and then refeshing it.

Cheers,
Tiago Simões
Solution
Tiago,

You are right that list_sortcolumn does not work with editable table, the order by column remains the same. I have to add extra variables and code to the screen action to manage the sorting via explict list_sortcolumn_setorderby calls.

Thanks,
Stanley

One way to make it work is adding a TableRecords Style into your EditableTable widget.



This seems to work since although the RichWidgets\List_SortColumn widget's JavaScript is only prepared for TableRecords, it can be tricked into working with an EditableTable, too:



See a working example here.

Cheers!