cancel
Showing results for 
Search instead for 
Did you mean: 

Table Sorting

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Ramprasad,

I think you havenot mentioned the columns to be sorted

check this thread

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

Former Member
0 Kudos

Hi Ramprasad,

This thread explaining similar issue:

Thanks

Krishna

Former Member
0 Kudos

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

Former Member
0 Kudos

check this