Search code examples
javasmartgwt

getting the number of filtered results in a listgrid (smartgwt)


I'm having a listgrid filled with entries, with filtering enabled. when I execute the filter the listgrid gets updated accordingly. Now I want to get the number of results that were found with the filters. I tried adding the FilterEditorSubmitHandler but that gets executed before the filter is actually executed (and also the listGrid.getDataSource().getFields() always returns 0.

Is there a way to get the number of results after the filter was applied? to be more precise: the FilterEditorSubmitHandler is called before the actual filtering, and I need a handler that gets called after the filter was applied, or right after the grid was updated again


Solution

  • I just found the correct handler.

    the DataArrivedHandler works after a filter is executed and gets the correct number of results. On the first fill of the ListGrid it returns 0 though, but when filling the DataSource I already know the size of the Set I retrieve.

    as a side note: I'm using an RPC call to get the data out of the DB, and not the SmartGWT server stuff.