Hi,
I'm going to http://app.lightstreamer.com/GridDemo/ and save as *.html, and modified something --> http://www.gls.com.vn:8080/priceonline/test.htm


In GridDemo source (before i modified) :

//////////////////////////Format callbacks

function updateItem(item, updateInfo) {
if (updateInfo == null) {
return;
}
if (updateInfo.isValueChanged("pct_change")) {
var val = updateInfo.getNewValue("pct_change");
}

var oldLast = updateInfo.getOldValue("last_price");
var newColor;
if (oldLast == null) { //first update for this item
updateInfo.addField("color",upColor,true);
updateInfo.addField("illuminate","OFF",false);
} else if (updateInfo.isValueChanged("last_price")) {
//at least second update
var newPrice = updateInfo.getNewValue("last_price");
if (oldLast > newPrice) {
updateInfo.addField("color",downColor,true);
} else {
updateInfo.addField("color",upColor,true);
}
}
}

-------
Here my changed :
-------

var redColor = "F70033"
var greenColor = "2EFF00";
var yellowColor = "#FFFF00";

function updateItem(item, updateInfo)
{
....
var oldLast = updateInfo.getOldValue("last_price");
var newColor;
if (oldLast == null)
{
//first update for this item
updateInfo.addField("color",greenColor,true); //updateInfo.addField("illuminate","OFF",false);
}

else if (updateInfo.isValueChanged("last_price"))
{
//at least second update
var newPrice = updateInfo.getNewValue("last_price");
if (oldLast > newPrice)
{
updateInfo.addField("color",redColor,true);
}
else if (oldLast < newPrice)
{
updateInfo.addField("color", greenColor,true);
}
else if (oldLast == newPrice)
{
updateInfo.addField("color",yellowColor,true);
}
}
}

--------

It didn't show color when "last_price" field has changed. What's wrong?