Announcement

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

    Listgrid: Sort and filter only by server (without local cache)

    Hello community!

    If you say a listgrid to fetch its data and all data are in local cache, SmartClient tries to sort and filter clientside.

    Does anybody know how to tell the listgrid not to do this? It should always fetch data by asking the server (this is not very performant, but I need this cuz filtering and sorting joins tables in the database, so only sorting by "text" is wrong).

    Kind regards - and MERRY CHRISTMAS!
    Alex

    #2
    any idea?

    Kind regards
    Alex

    Comment


      #3
      I think the following code in the ListGrid should work :

      Code:
      addDataArrivedHandler(new DataArrivedHandler() {
      			public void onDataArrived(DataArrivedEvent event) {
      				getResultSet().setUseClientFiltering(false);
      			}
      		});

      Comment


        #4
        Use setDataProperties instead.

        Comment


          #5
          Thanks at all.

          This worked:

          isc.ResultSet.addProperties({ useClientFiltering:false });
          isc.ResultSet.addProperties({ useClientSorting:false });

          Comment


            #6
            swetan your solution works, thank you

            Isomorphic could you show an example of what your proposing and what the difference is?

            Comment


              #7
              The specific API is listGrid.setDataProperties().

              Comment


                #8
                So the proper example would be this ?

                This looks the same just made longer...please explain.

                Code:
                addDataArrivedHandler(new DataArrivedHandler() {
                			public void onDataArrived(DataArrivedEvent event) {
                                                ResultSet rs = myListGrid.getResultSet();
                				rs.setUseClientFiltering(false);
                				myListGrid.setDataProperties(rs);
                			}
                		});

                Comment


                  #9
                  No, call setDataProperties when the grid is constructed, and do not have an onDataArrived handler at all.

                  Comment


                    #10
                    Works perfectly, thank you.

                    Code:
                    ResultSet rs = new ResultSet();
                    rs.setUseClientFiltering(false);
                    myListGrid.setDataProperties(rs);

                    Comment

                    Working...
                    X