• Client API
  • 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 :
<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
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.
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