|
|
|
|
Re: NatTabel sort failing [message #1472121 is a reply to message #1470854] |
Thu, 13 November 2014 16:11 |
Amruta Sardeshmukh Messages: 25 Registered: September 2014 |
Junior Member |
|
|
I have added default Sort ConfigurationcoverSheetNatTable.addConfiguration(new DefaultSortConfiguration());
Created sortModel
sortModel = new GlazedListsSortModel(getSortedList(), columnPropertyAccessor, configRegistry, columnGroupHeaderLayer);
this.sortHeaderLayer = new SortHeaderLayer(columnGroupHeaderLayer,
sortModel, false)
I am implementing the sort through command ,which is available on column header
public void registerSortCommandHandler(final ISortModel sortModel, final SortHeaderLayer sortHeaderLayer)
{
registerCommandHandler(new SortCommandHandler(sortModel,sortHeaderLayer)
}
Added menu item for sort
public void addMenuItem(final NatTable natTable, final Menu popUpMenu)
{
MenuItem multiEditMenuItem = new MenuItem(popUpMenu, SWT.NONE);
multiEditMenuItem.setText("Sort\t");
multiEditMenuItem.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event arg0)
{
// natTable.doCommand(new TCNatTablePasteDataCommand("\t", System
// .getProperty("line.separator")));
NatEventData obj = (NatEventData) popUpMenu.getData();
final int colIndex = natTable.getColumnIndexByPosition(obj.getColumnPosition());
natTable.doCommand(new SortColumnCommand(natTable,colIndex,false));
//natTable.refresh();
}
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.24696 seconds