client-side filtering in GridControl

Raymond Li
  • Raymond Li

    Raymond Li - 2011-06-15

    Dear all,
    Does any one know how can I do client-side filtering with GridControl?

    I could already do server-side filtering by using  something like

    FilterWhereClause f = new FilterWhereClause("name",Consts.LIKE,list);
          grid.getQuickFilterValues().put("subjectname", new FilterWhereClause{f,null});

    Indeed, I want to let the user to search for keyword in multiple columns.

    Thanks in advance!


  • Raymond Li

    Raymond Li - 2011-06-16


    I have studied JTable's filter mechanism in these two days.

    It seems that we can make use of setRowSorter() in class TableRowSorter. And we can call setRowSorter() from Grid (which inherited from JTable), so that we can make use of RowFilter.

    Therefore, we can add a client-side filtering logic to Grid by exposing a function to set a RowFilter.

    Does anyone has opinions?


  • Raymond Li

    Raymond Li - 2011-06-16

                            Failed to implement Client-side filtering with TableRowSorter and setRowFilter().

    I just tried to add a sorter to member variable "grid" in Grids. Like the following

      private TableRowSorter<VOListTableModel> sorter;

    And then I call setRowFilter() to the sorter. But I failed. The screen will not refresh. And when I scroll it, it will not repaint correctly.

    I think I have not understood the painting logic of GridControl.

    I will study more. But I would be grateful if anyone give me some hints or sharing.


  • Raymond Li

    Raymond Li - 2011-06-20

    I have make a amended GridControl to implement setRowFilter(). When the amendment, I can use RowFilter to carry out client-side filtering.

    In additional, we can use DocumentListener to update the RowFilter. Subsequently, a very smooth searching effect could be achieved.

    I would share some codes soon.


  • mcarniel

    mcarniel - 2011-09-24

    Why not simply use the quick filter feature available for every column?
    Anyway, you can always pass to the server side any other conditions using gridcontrol.getOtherGridParams() and programatically manage them on the server side…


Log in to post a comment.