Hi Priyanka,


Please, let me recommend again to use a DynaGrid although with the MERGE mode.

Something like this should work in your case:


Code:
<html>
<body>
<br><br>
<div> <td> Light Streamer message:<br>

</td>
</div>
 <table>
 <tr class="tablerow" id="stocks" data-source="lightstreamer" >
	<td><div data-source="lightstreamer" data-field="topicdata"></div></td>
  </tr>
<table>

<script src="js/require.js"></script>
<script src="js/lightstreamer.js"></script>

<!-- JavaScript code specific of this application -->
<script type="text/javascript">
var count =0;

require(["js/lsClient","Subscription","DynaGrid"],
function(lsClient,Subscription,DynaGrid) {

var stockSubscription = new Subscription("MERGE","item2",["topicdata"]);
stockSubscription.setDataAdapter("QUOTE_ADAPTER");
stockSubscription.setRequestedSnapshot("yes");
stockSubscription.setRequestedMaxFrequency("unfiltered");
 
var myGrid = new DynaGrid("stocks",true);
myGrid.setAutoCleanBehavior(true,false);
myGrid.forceSubscriptionInterpretation("UPDATE_IS_KEY");
myGrid.addListener({
onVisualUpdate: function(key, visualUpdate, domNode) {
	var d = new Date();
	var starttime = 0;
	var endtime = 0;
	if(count==1) {
		starttime = d.getMilliseconds();
	} else {
		endtime = d.getMilliseconds();
	}

	if (visualUpdate != null) {
		visualUpdate.forEachChangedField(function changedFieldCallback(field, value){
			var arrayofitems = ['Count:',count++,'Time:',endtime-starttime,'Message :',visualUpdate.getCellValue("topicdata")];
			visualUpdate.setCellValue("topicdata", arrayofitems);
			var1= arrayofitems;
			console.log(var1);
		});
	}


}
 });
 
 
 stockSubscription.addListener(myGrid);
lsClient.subscribe(stockSubscription);
});
</script>
<script>
//////////////// Connect to current host (or localhost) and configure a StatusWidget

define("js/lsClient",["LightstreamerClient","StatusWidget"],
function(LightstreamerClient,StatusWidget) {

var protocolToUse = document.location.protocol != "file:" ? document.location.protocol : "http:";
var portToUse = document.location.protocol == "https:" ? "443" : "8080";
// in accordance with the port configuration in the factory lightstreamer_conf.xml
// (although the https port is not open by the factory lightstreamer_conf.xml)

var lsClient = new LightstreamerClient(protocolToUse+"//localhost:"+portToUse,"WELCOME");
lsClient.connectionSharing.enableSharing("DemoCommonConnection", "ATTACH", "CREATE");
lsClient.addListener(new StatusWidget("left", "0px", true));
lsClient.connect();

return lsClient;
});
</script>

</body>

</html>
Regards,
Giuseppe