Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Feb 2008
    Location
    chicago
    Posts
    5

    [Ext Js] client-side sorting/column re-ordering issue

    i am using lightstreamer with an OverwriteTable to populate an extJS grid that has sorting and column re-ordering. when the grid is sorted or a column is moved, the grid stops receiving updates from lightstreamer. each cell in the grid is created as a <div> element with source, table, item and field attributes. using firebug, i see that this is converted into and id attribute with the following format: "F|table|item|field|div". i have tried moving the id along with the cell, but it appears that lightstreamer does not recognize the id or is using some other method to perform its updates.

    i could use some help in restoring the association so that lightstreamer updates are reflected automatically.

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hello,

    our library mantains a cache of pointers to the html tags. To let Lightstreamer update moved elements you should move the entire element not just the id.
    Btw, if you are already using a non-lightstreamer grid it could be better if instead of an OverwriteTable you use a NonVisualTable.
    It's the same approach taken on this demo where a Dojo Grid is used to display the data: http://www.lightstreamer.com/dojoDemo.htm - http://app.lightstreamer.com/DojoDemo

  3. #3
    Member
    Join Date
    Feb 2008
    Location
    chicago
    Posts
    5
    so your library will keep track of elements moved within the dom? currently, i am setting the subscription info on a <div> that is created within a cell renderer. these elements are discarded when the column is moved or sorted. i will try to attach the subscription data to the <div> on level up, but i think i will have to dig into the ext js library to accomplish that.

    in the interim, i will switch to using a NonVisualTable and updating the values directly.

    thx

  4. #4
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    ok, let me know your progress or if you need further details.

  5. #5
    Member
    Join Date
    Feb 2008
    Location
    chicago
    Posts
    5
    i haven't had much time to spend on moving to NonVisualTable, but i am getting an error (this.LS_gwJ has no properties lspushpage.js: Line 7)adding the table to the push page. the code is below. looking at the example that you cited, i think that my problem has something to do with passing null for group descriptor and schema or invoking createEngine instead of loadEngineMinimal (which doen't seem to be documented). what confuses me is that i can create an OverwriteTable with null group descriptor and schema.

    Code:
    //***** common *****
    var lsPage = new PushPage();
    var debugAlerts = false;
    var remoteAlerts = true;
    var pushHost = null;
    lsPage.context.setDomain(domainName);
    lsPage.context.setDebugAlertsOnClientError(debugAlerts);
    lsPage.context.setRemoteAlertsOnClientError(remoteAlerts);
    
    lsPage.onEngineCreation = function(lsEngine) {
    	lightStreamerEngine = lsEngine;
    				   
    	lsEngine.context.setDebugAlertsOnClientError(debugAlerts);
    	lsEngine.context.setRemoteAlertsOnClientError(remoteAlerts);
    	lsEngine.connection.setLSHost(pushHost);
    	lsEngine.connection.setLSPort(webServerPort);
    	lsEngine.connection.setAdapterName(adapterName);
    	lsEngine.policy.setMaxBandwidth(5);
    	lsEngine.policy.setIdleTimeout(30000);
    	lsEngine.policy.setPollingInterval(1000);
    	lsEngine.changeStatus("STREAMING");
    }
    
    lsPage.bind();
    lsPage.createEngine("SLEngine","ls/","SHARE_SESSION");
    //***** common *****
    
    function addPushTable(tableName, updateFnc, formatFnc) {
    	var newTable = new OverwriteTable(null, null, "MERGE");
    	newTable.setSnapshotRequired(true);
    	newTable.setClearOnDisconnected(false); //default is false
    	newTable.setClearOnRemove(false); //default is false
    	newTable.onItemUpdate = updateFnc;
    	newTable.onChangingValues = formatFnc;
    	newTable.setPushedHtmlEnabled(false);
    	lsPage.addTable(newTable, tableName);
    }
    
    function addNonVisualPushTable(tableName, updateFunction) {
    	var newTable = new NonVisualTable(null, null, "MERGE");
    	newTable.setSnapshotRequired(true);
    	newTable.onItemUpdate = updateFunction;
    	lsPage.addTable(newTable, tableName);
    }

  6. #6
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hello,

    loadEngineMinimal is no more documented as it was deprecated some time ago and is now completely removed from documentation even if the method is still in the code.

    You can create an OverwriteTable passing null as group and schema because in that caseduring the addTable call the library checks the DOM to find associated elements and reads item and fields from there.
    If you use a NonVisualTable there are no associated cells so that you must specify group and schema in the constructor.

    Take a look to this example: http://www.lightstreamer.com/vb/showthread.php?t=49

  7. #7
    Member
    Join Date
    Sep 2010
    Location
    ny
    Posts
    1
    That is really a impressive topic..Thank you for sharing this with us. I am already searching about that. I need it for my final MBA project relted that information. I need the disscussion about that. Thanks for info.
    Awaiting for more....
    Thanks in advance!!!

 

 

Similar Threads

  1. Replies: 7
    Last Post: June 14th, 2012, 09:35 AM
  2. How to turn on LS client side logging?
    By LS_Developer in forum Client APIs
    Replies: 1
    Last Post: March 20th, 2012, 09:51 AM
  3. Client side publish support
    By pacesie in forum General
    Replies: 1
    Last Post: March 26th, 2008, 10:01 AM
  4. Replies: 2
    Last Post: February 5th, 2008, 06:28 PM

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:52 PM.