Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ListGrid use filtered data

    Hello,

    I am trying to do the following but I cannot figure out what is the best approach.

    I have a ListGrid, where users can filter the shown data. I would like to get this filtered data, open a new smartgwt window (or tab, etc, this is unimportant) , show there a new ListGrid with only this filtered data, so the users cannot remove the filter from the second grid, and finally do something with those records.

    I have the code for doing an excel export from a listgrid, which only exports the filtered data, ... what I am trying to do is something similar: "do something" with only the filtered data from a listgrid, just like the excel export function:

    DSRequest dsRequestProperties = new DSRequest();
    dsRequestProperties.setExportAs((ExportFormat)EnumUtil.getEnum(ExportFormat.values(), "xls"));
    dsRequestProperties.setExportDisplay(ExportDisplay.DOWNLOAD);
    dsRequestProperties.setOperationId(grid.getFetchOperation());
    grid.exportData(dsRequestProperties);

    What is the best approach using SmartGWT 3.0 EE ?


    Thank you

    #2
    This seems pretty much unrelated to export. Just create a new ListGrid and have it fetchData() with the same criteria from the original ListGrid, and don't show an controls for the user to be able to change the criteria.

    Comment


      #3
      Can this be done at the server end rather than returning data set to client then filtering ? For example using the $criteria.parametervalue in the SQL statement in the .ds.xml (for say a customSQL) ?

      How would you pass the parametervalue from the client in this situation.

      Comment


        #4
        Don't really follow the question. If you create a new grid with the same criteria, it will do a server fetch, so the first grid remains untouched and you can feel free to manipulate the dataset in the second grid without affecting the first. However there would be no need to add extra server code for this - you're just using the same server fetch.

        Comment


          #5
          My question was worded poorly. I have however realized that a detailed explanation of my question addressed in the EE showcase SQL->Dynamic Reporting.

          Thanks.

          Comment

          Working...
          X