Announcement

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

    Register a client side sort callback function for ListGrid server sort

    Hello,
    We are using: SmartClient_80_Pro.

    I’m using server sort and a custom data source which extend the BasicDataSource. In the executeFetch function, I return some extra data (besides the data for the ListGrid) through the DSResponse.setProperty method, and I need these data for the page display.

    On the client side, I disabled the autoFetchData. I call fetchData with a fetchData callback function. In the call back function, I inspect the data for the grid and also retrieve the extra data sent back from the server through the DSResponse.setProperty.

    Is there a way to register a sort callback function (which is similar to the fetchData call back) so that when sort is performed, I can retrieve the extra data (besides the ListGrid data) that are sent back through the DSResponse.setProperty method?

    If this is not supported, do you have any suggestions on how to accomplish this?

    Thanks!

    #2
    When a sort operation occurs on a listGrid (which doesn't have a full cache of data already loaded on the client), the operation passed to the server is a standard fetch operation, with sortByFields specified.

    ---
    Update: On re-reading your question, it sounds like you want a client-side callback so the sequence of events is -- user sorts the grid (EG clicking a header), sort occurs on the server, then when the response comes back you have some custom code execute.
    Since you're doing the same thing in response to fetches, how about a transformResponse override on your dataSource?

    Alternatively you may be able to make use of the dataArrived handler at the grid level.
    Last edited by Isomorphic; 31 Mar 2011, 14:01.

    Comment


      #3
      Thanks for the suggestions. Yes, I get around it using the dataArrived method. It doesn't give me access to the dsRequest object where the extra data is attached to, but I'm able to get around this by caching the similar information previously returned throught the fetchData callback at the client side.

      Comment

      Working...
      X