Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Jan 2011
    Location
    Hyderabad
    Posts
    1

    Question Uncaught [|IllegalStateException|Please specify at least one cell|]

    Hello,

    On Our stocks ticks page, I get his error "Uncaught [|IllegalStateException|Please specify at least one cell|]"
    After ajax call, my DIV element will populated with html table with necessary attribute in td (data-source, data-item ... )

    example :
    Code:
    <td style="text-align:right;" id="abc123"><span data-source="lightstreamer" data-grid="aTable" data-item="abc_x_123" data-field="last">123.456</span></td>
    then we are making a call to light streamer code as follow
    Code:
    require(["LightstreamerClient","Subscription","StaticGrid"],function(LightstreamerClient,Subscription,StaticGrid) {
            var client = new LightstreamerClient("https://xxx.yyyyyyy.com","TEST");
            client.connect();
            var grid = new StaticGrid("aTable", true);
            grid.addListener({
    			onVisualUpdate: function(key, info, domNode) {
    				if (info == null) {
    					return;
    				}
    				var myField;
    				info.setHotTime(2000);
    				info.forEachChangedField(function (field, value) {
    					if(field == "time" || field == "da" || field == "dp") {
    						return;
    					}
    					myField = field;
    		        	var lastPrice = value;
    					if (lastPrice !== null) {
    						var prevPrice = grid.getValue(key, myField);
    						if (!prevPrice || lastPrice > prevPrice) {
    							info.setCellAttribute(myField, greenColor, null,"backgroundColor");
    							info.setCellAttribute(myField, hotTxtCol, null,"color");
    						} else {
    							info.setCellAttribute(myField, redColor, null, "backgroundColor");
    							info.setCellAttribute(myField, hotTxtCol, null,"color");
    						}
    					}
    				});
    			}
    		});
            subscription = new Subscription("MERGE", grid.extractItemList(), fieldList);
            subscription.addListener(grid);
            client.subscribe(subscription);
          });
    let me know, How can I fix it?

    Thanks in advance.
    Last edited by pmahenderreddy; November 5th, 2015 at 03:37 AM. Reason: "data-table" changed to "data-grid"

  2. #2
    Administrator
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    152
    Hi Mahender,

    please consider that when you instantiate a StaticGrid with the second parameter set as "true", the html is parsed before the constructor execution is completed, which means that all DOM elements must be present in the page. But this is not your case, since your the table is going to be populated only after the AJAX call has completed.

    To fix this issue, you should pass "false" as second parameter and invoke the parseHtml later by other custom code, once the table has been built.

    Let me know if this helps.

    Regards, Gianluca

 

 

Similar Threads

  1. Replies: 20
    Last Post: January 15th, 2015, 12:52 PM
  2. Replies: 3
    Last Post: September 28th, 2012, 11:02 AM
  3. Replies: 1
    Last Post: July 7th, 2010, 03:13 PM
  4. How And Where To Specify Database As Data Feed?
    By devidasan in forum Adapter APIs
    Replies: 1
    Last Post: March 17th, 2009, 12:00 PM
  5. How to specify the Adapter mode
    By ksivasam in forum Adapter Protocol
    Replies: 9
    Last Post: January 18th, 2008, 10:47 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:08 PM.