Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Dec 2009
    Location
    athens
    Posts
    6

    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");
    }

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    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.

  3. #3
    Member
    Join Date
    Dec 2009
    Location
    athens
    Posts
    14

    error running javascript on missing item


 

 

Similar Threads

  1. Replies: 1
    Last Post: May 25th, 2012, 10:03 AM
  2. Replies: 8
    Last Post: March 25th, 2010, 10:02 AM
  3. Incremental fields subscription
    By Pradeep Chahal in forum Client SDKs
    Replies: 1
    Last Post: February 2nd, 2010, 11:11 AM
  4. Incremental fields subscription
    By Pradeep Chahal in forum Adapter SDKs
    Replies: 1
    Last Post: February 2nd, 2010, 10:23 AM
  5. How to Get all updated fields in one attempt?
    By indrajit in forum Client SDKs
    Replies: 3
    Last Post: March 3rd, 2008, 09:59 AM

Tags for this Thread

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 10:54 AM.