cancel
Showing results for 
Search instead for 
Did you mean: 

Finding column for Tablesorter

former_member185029
Active Contributor
0 Kudos

Hi,

After implementing [table sorter|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3287] [original link is broken] [original link is broken] [original link is broken]; is there any way I can find which column has been clicked for sorting?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You will be able to find this from the following method


public void sort(IWDCustomEvent wdEvent, IWDNode dataSource) {
		// find the things we need
		String columnId = wdEvent.getString("selectedColumn");
		String direction = wdEvent.getString("sortDirection");
		IWDTableColumn column = (IWDTableColumn) table.getView().getElement(columnId);
		NodeElementByAttributeComparator elementComparator = (NodeElementByAttributeComparator) comparatorForColumn.get(column);
		
		if (elementComparator == null){
			//not a sortable column
			column.setSortState(WDTableColumnSortDirection.NOT_SORTABLE);
			return; 
		}
		
		// sorting
		elementComparator.setSortDirection(WDTableColumnSortDirection.valueOf(direction));
		dataSource.sortElements(elementComparator);
	}

Regards

Ayyapparaj

former_member185029
Active Contributor
0 Kudos

Thank you for the quick help.

-Ashutosh

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ashutosh

Hope this link is helpful for you

Regards

Ruturaj

former_member185029
Active Contributor
0 Kudos

Dear Ruturaj,

If you read my question carefully, its the same link I mentioned in the question.

Thank you for your answer though

-Ashutosh