Sorting a CellTable server-side

后端 未结 4 1298
说谎
说谎 2021-01-24 14:30

I\'m currently using a Gwt CellTable, bound to my GAE/Objectify backend via RPC calls.

All right now! :-)

Then I want to sort columns, so I read http://code.goog

4条回答
  •  忘掉有多难
    2021-01-24 14:45

    I have used something like this as an application column object.

    public class ScrollTableColumn {

        // --------------------------------------------------------------- Field(s)
    
        private int            sequence;
        private Column         column;
        private Header         header;
        private int            size;
        private int            calculatedSize;
        private boolean        show;
        private PartialColumn  partialColumn;
        private ColumnNameEnum columnName;
    

    }

    Now create a HashMap of the above as follows:

    Map columnMap 
        = new HashMap();
    

    Add all the columns as you create them both in the ScrollTableColumn and in the columnMap.

    Finally you can get the required name as:

    ColumnSortList sortList = dataTable.getColumnSortList();
    Column column = sortList.get(0).getColumn();
    ColumnNameEnum = columnMap.get(column);
    String name = ColumnNameEnum.getName();
    

提交回复
热议问题