Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Sep 2007
    Location
    Chicago
    Posts
    20

    Sorting in command mode

    We have a about 200 entries and we have to use a 'Grid' setup to display 25 entries at a time. But user wants to be able to sort the grid on any one of the 5 columns. But the sorting should sort the entire 200 entries.

    We also need to use the COMMAND mode as the entries may be added/deleted/updated.

    This is a very tricky situation, not sure how to handle this.

    Any help is very appreciated!

    Kal

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    521
    Hi Kal,

    To achieve that, the client needs to receive the real-time updates for all the 200 entries, even if only 25 are displayed at a time. Otherwise the sort should be done on the server side and some sorting key should be pushed back, but this scenario would be very complicated to design and implement.

    So it depends on the update frequency. If the JavaScript client is able to handle non-visual updates for 200 items and sort them in real-time, then you could use a "two-level push" approach.

    You subscribe to a global item in COMMAND mode, that will push only two fields:
    - command: ADD, UPDATE, or DELETE
    - key: the item name for an actual row (that is, an underlying item)

    For each received ADD, you subscribe, through a new NonVisualTable, to the underlying item (with its full schema comprising five fields) in MERGE mode. In this way, you can keep a data structure with the current values for 200x5 fields. You will do in-memory sorting in real-time to know what are the underlying items that should be displayed in the visible portion. Based on that, you will update the view of the visible portion with the real-time data.

    A bit tricky, but should work, if the JS client is not bombarder by too many updates on the 1000 concurrent fields.

  3. #3
    Member
    Join Date
    Sep 2007
    Location
    Chicago
    Posts
    20
    Thanks Alessandro! We will see if there is a performance hit with this.

    At the worst case, we will send a sort key to the server and have it sort. We can clear the entries from the push table and have the server resend.

    So we don't need to worry about the number of entries we need handle in the client side.

  4. #4
    Member
    Join Date
    Sep 2007
    Location
    Chicago
    Posts
    20

    Sort with DynaMetaPush table

    Hi,

    We tried out the sorting/pagination interfaces of this table in COMMAND mode and looks like they work fine.

    We are using the following methods:

    setMaxDynaRows()
    setMetapushSort()
    getCurrentPages()
    goToPage()

    We use the COMMAND mode and displaying 25 rows per page. We are building the pagination links using (Total pages = getCurrentPages()/25). We rebuild the page links in the item call backs and see if the total pages is changed from the last update.

    Is there a reason we shouldn't be using them for sorting and pagination?

    We tried with 500 rows and did not see any performance issues. How is the sort handled and where is the data stored (client/server)?

    Thanks,
    Kal

  5. #5
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hi,

    The sort is performed on the client side.
    The weigth on the CPU is relative to the number of rows and the frequency of the updates of your feed so that if you don't see any performance issues in your tests you should not worry about that.

    Note that all the updates are received by the client to keep the view sorted.
    Take a look here: http://app.lightstreamer.com/PagedPortfolioDemo

    (Total pages = getCurrentPages()/25)
    Note that the getCurrentPages method already returns the number of pages.
    The onCurrentPagesChanged callback will notify you if the number of pages is increased or decreased.
    see http://www.lightstreamer.com/docs/cl...pushTable.html

    HTH

  6. #6
    Member
    Join Date
    Sep 2007
    Location
    Chicago
    Posts
    20
    Hi,

    That demo page helped out a lot.

    Thanks!

    -Kal

 

 

Similar Threads

  1. command mode
    By Pradeep Chahal in forum Adapter SDKs
    Replies: 1
    Last Post: February 24th, 2010, 10:52 AM
  2. command mode
    By Pradeep Chahal in forum Client SDKs
    Replies: 2
    Last Post: February 15th, 2010, 11:20 AM
  3. NonVisualTable with COMMAND mode
    By Alessandro in forum Client SDKs
    Replies: 2
    Last Post: June 17th, 2009, 12:50 PM
  4. COMMAND mode
    By atnemeth in forum Client SDKs
    Replies: 3
    Last Post: May 19th, 2008, 11:19 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 05:26 AM.