-
May 24th, 2012, 08:17 PM
#1
use images arrow up/down and user calculated fields
Hi
i use with lightstreamer version 4 the code below
to change the image to a user field #arrow
if (updateInfo.isValueChanged("p_last")) {
var val = updateInfo.getNewValue("p_dif");
if (val.indexOf("-") > -1) {
updateInfo.addField("#arrow",imgDown);
} else {
updateInfo.addField("#arrow",imgUp);
}
}
with version 5 Colosseo it is possible with StaticGrid to change image for a field up/down !?
and in version 5 the arrow field is without # is this important !!!??
because i have some calculated fields , like #value = quantity * last_price
i have to use DynaGrid or it is posible with StaticGrid !!??
with the code below the images with StaticGrid are not changing
//put arrow and handle change style
var pctChange = info.getChangedFieldValue("p_chng");
if (pctChange !== null) {
pctChange = formatDecimal(pctChange,2,true)+"%";
hotTxtCol = (pctChange.charAt(0) == '-') ? "#dd0000" : "#009900";
if (pctChange.indexOf("-") > -1) {
info.setCellValue("#arrow",imgDown);
info.setCellAttribute("#arrow",cold,cold,"backgrou ndColor");
info.setCellAttribute("p_chng","black",hotTxtCol," color");
info.setCellValue("p_chng",pctChange);
} else {
info.setCellValue("#arrow",imgUp);
info.setCellAttribute("#arrow",cold,cold,"backgrou ndColor");
info.setCellAttribute("p_chng","black",hotTxtCol," color");
info.setCellValue("p_chng","+"+pctChange);
}
info.setCellAttribute("p_chng","bold","bold","font Weight");
}
-
May 25th, 2012, 09:03 AM
#2
Yes, I confirm that StaticGrid let you to change image for fields like up/down.
We assume that the HTML code for the cell is something like this:
...
...
and that the StaticGrid is created with this code:
then your code should work fine.
Please note that It's important to call parseHtml after the setNodeTypes since the default not includes <img> type.
About # it's not very important in this case, please refer to http://www.lightstreamer.com/docs/cl...tractFieldList for more details about extra subscription fields.
-
June 7th, 2012, 01:49 PM
#3
error running javascript on missing item
Similar Threads
-
By metero in forum General
Replies: 1
Last Post: May 25th, 2012, 09:03 AM
-
By hungn in forum Client SDKs
Replies: 8
Last Post: March 25th, 2010, 09:02 AM
-
By Pradeep Chahal in forum Client SDKs
Replies: 1
Last Post: February 2nd, 2010, 10:11 AM
-
By Pradeep Chahal in forum Adapter SDKs
Replies: 1
Last Post: February 2nd, 2010, 09:23 AM
-
By indrajit in forum Client SDKs
Replies: 3
Last Post: March 3rd, 2008, 08:59 AM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 08:01 PM.
Bookmarks