cancel
Showing results for 
Search instead for 
Did you mean: 

execute tableSorter

Former Member
0 Kudos

Hi,all

I need to execute tableSorter at the first time my table is showing.

I fill my table in DoInit() method and call the initialSort() method which

I created.

initialSort()

{

wdContext.currentContextElement().getTableSorter().sort("Column2",wdContext.nodeUserTable());

}

But initialSort is not executed.Why?

Regards,

Michael

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ,

You need to first set the TableSorter like this in wdDoModifyView..

if (firstTime) {
 
      IWDTable table = (IWDTable) view.getElement("ShoppingBasket");

      wdContext.currentContextElement().setTableSorter(

        new TableSorter(table, wdThis.wdGetSortAction(), null));

}   

If it does not work even after it is added , you can put the .sort function also inside wdDoModifyView's

if(firstTime)

.

Regards

Bharathwaj

Former Member
0 Kudos

Hi,Bharathwaj

Thanks for your reply,the second is working.

I have one more question.In my table I have 44 rows.When the table

was sorted,I see the rows from row 22 .How can I see the table from

the top part?

Regards,

Michael

Former Member
0 Kudos

Hi ,

It might be either that , it showing the leadselected element as the first row..

try

wdContext.node<nodename>.setLeadSelection(-1);

Do this inside wdDoModify ,before you call the sort function..

Regards

Bharathwaj

Former Member
0 Kudos

Bharathwaj,

thanks for your help,it is working,

all points for you

Regards,

Michael

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

after sorting, set the Leadselelction to '0'

like wdContext.nodeX.setLeadSelection(0);

AM