Skip to Content
avatar image
Former Member

Table Sorting

Im unable to sort the table data

Procedure What i followed

1.i Created attribute called Sorter of java native Type package.TableSorter

2.i'm add following code in modifyview

//@@begin wdDoModifyView

if (firstTime) {

IWDTable table = (IWDTable) view.getElement("Table");

wdContext.currentContextElement().setTableSorter(new TableSorter(table, wdThis.wdGetSortAction(), null));

3.And also method onActionSort

onActionSort()

//@@begin onActionSort(ServerEvent)

wdContext.currentContextElement().getTableSorter().sort(wdEvent, wdContext.nodeProducts());

//@@end

4. program code for the sort class under sac u2192 packages -packagename.TableSorter

5.in table properties Events-

onsort -Sort

but still i'm not able to sort the table data .....

after deploying i can able to see Up arrow and Down Arrow in table Header ........for sorting

when i'm selecting any arrows for sorting i'm not able to sort and also Arrow marks disappears for particular column when i selected

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Sep 27, 2008 at 12:34 AM

    check this

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 27, 2008 at 05:25 AM

    Hi Ramprasad,

    This thread explaining similar issue:

    table-sorter

    Thanks

    Krishna

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi!

      replace your code by

      if(firstTime)

      {

      view.nowCreateAllCustomExtensionFields();

      IWDTable tab= (IWDTable)view.getElement("Table");

      wdContext.currentContextElement().setCustomerTableSorter(new TableSorter(tab,wdThis.wdGetTableSortAction(),new HashTable() ,new String[] {"Customers") ));

      }

      do organize imports

      thanks

      vishal

  • avatar image
    Former Member
    Sep 27, 2008 at 03:41 PM

    Ramprasad,

    I think you havenot mentioned the columns to be sorted

    check this thread

    Tablesorter class

    write this code in wddomodifyview

    if (firstTime) {

    if (null != view) {

    IWDTable table = (IWDTable) view.getElement("Table");

    //IWDTable table1 = (IWDTable) view.getElement("Table1");

    wdContext.currentContextElement().setTableSorter(

    new TableSorter(

    table,

    wdThis.wdGetSortAction(),

    null,

    new String[] {

    "Column",

    "Column1",

    "Column2",

    "Column3",

    "Column4",

    "Column5",

    "Column6" }));

    }

    column1,column2 are the table clumns

    Associate an action onsort of the table and write this code in the onsortaction

    wdContext.currentContextElement().getTableSorter().sort(

    wdEvent,

    wdContext.nodeFilter_Salary());

    Thanks

    Bala Duvvuri

    Add comment
    10|10000 characters needed characters exceeded