Results 1 to 10 of 10

Hybrid View

  1. #1
    Senior Member
    Join Date
    Oct 2007
    Location
    HoChiMinh
    Posts
    69
    Hi Mone,
    Thank for your help. I fixed (format value) --> http://www.gls.com.vn:8080/priceonline/test.htm
    I'm not able to ping your server at the moment
    Because my firewall not allow ping command.

    You've commented out this code:
    updateInfo.addField("illuminate","OFF",false);
    Yes, i'm commented this code.

    Now in NonVisualTable, i have (see below):
    ------
    function formatValues(item, itemUpdate)
    {
    ...
    var PriceRe=parseFloat(itemUpdate.getServerValue("ref_ price"));

    // format bid1vol, bid1 price, bid2vol, bid2 price, bid3vol, bid3 price
    for (var i=4;i<=9;i+=2)
    {
    //ATO, ATC
    if (isNaN(itemUpdate.getServerValue(i)))
    {
    itemUpdate.setAttribute(i,"#FFFFFF","#FFFFFF","col or");
    //itemUpdate.setAttribute(i,"bold","bold","fontWeigh t");

    itemUpdate.setAttribute(i+1,"#FFFFFF","#FFFFFF","c olor");
    //itemUpdate.setAttribute(i+1,"bold","bold","fontWei ght");
    }

    else if (cf(itemUpdate.getServerValue(i))==PriceRe)
    {
    itemUpdate.setAttribute(i,yellowColor,yellowColor, "color");
    //itemUpdate.setAttribute(i,"bold","bold","fontWeigh t");
    itemUpdate.setAttribute(i+1,yellowColor,yellowColo r,"color");
    //itemUpdate.setAttribute(i+1,"bold","bold","fontWei ght");
    }
    else if (cf(itemUpdate.getServerValue(i))<PriceRe)
    {
    itemUpdate.setAttribute(i,redColor,redColor,"color ");
    //itemUpdate.setAttribute(i,"bold","bold","fontWeigh t");
    itemUpdate.setAttribute(i+1,redColor,redColor,"col or");
    //itemUpdate.setAttribute(i+1,"bold","bold","fontWei ght");
    }
    else if (cf(itemUpdate.getServerValue(i))>PriceRe)
    {
    itemUpdate.setAttribute(i,greenColor,greenColor,"c olor");
    //itemUpdate.setAttribute(i,"bold","bold","fontWeigh t");
    itemUpdate.setAttribute(i+1,greenColor,greenColor, "color");
    //itemUpdate.setAttribute(i+1,"bold","bold","fontWei ght");
    }
    }
    ...
    }
    --------
    My schema :
    ////////////////Global var declaration
    // 1. last_price, 2. time, 3. pct_change, 4. bid1, 5. bid1vol, 6. bid2, 7. bid2vol, 8. bid3, 9. bid3vol, 10.ref_price,
    // 11. open_price, 12. stock_name, 13. ceiling, 14. ask1, 15. ask1vol, 16. ask2, 17. ask2vol, 18.ask3, 19. ask3vol, 20. floor,
    // 21. min, 22. max, 23. lastVol, 24. lastVal, 25. price1, 26. vol1, 27. price2, 28. vol2, 29. room, 30. remainingroom,
    // 31. "vnIndex", 32. "idxVol", 33. "idxVal", 34. "idxchange", 35. idxperchange,
    // 36. item_status, 37. color, 38.fade, 39.image


    var schema = ["last_price", "time", "_change", "bid1", "bid1vol", "bid2", "bid2vol", "bid3", "bid3vol", "ref_price", "open_price", "stock_symbol", "ceiling" , "ask1", "ask1vol", "ask2", "ask2vol", "ask3", "ask3vol", "floor", "min", "max", "lastVol", "lastVal", "price1", "vol1", "price2", "vol2", "room", "remainingroom", "vnIndex", "idxVol", "idxVal", "idxchange", "idxperchange", "item_status"];

    ----
    Now in VisualTable, How do I do?

    My Error (see picture below) :


    Here my code :
    ----------
    // format _change
    var newValue = itemUpdate.getFormattedValue("_change");
    if (newValue != null)
    {
    var formattedVal = parseFloat(newValue);
    if (formattedVal > 0)
    {
    formattedVal = "+" + formattedVal;
    }

    if ((itemUpdate.getServerValue("last_price")) == itemUpdate.getServerValue("ceiling"))
    {
    //ceiling price
    formattedVal = "CE " + formattedVal;
    }
    else if ((itemUpdate.getServerValue("last_price")) == itemUpdate.getServerValue("floor"))
    {
    //floor price
    formattedVal = "FL " + formattedVal;
    }
    itemUpdate.setFormattedValue("_change",formattedVa l);
    } // end of if (newValue != null)

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    May you please clarify your goal? Are you trying to hide values that come as "NaN" from the Server?
    Note that the simplest way to have the value for field i not being shown is to "format" it as an empty string, through setFormattedValue(i, "");

 

 

Similar Threads

  1. Choice of VisualTable and Event handlers
    By genkijo in forum Client SDKs
    Replies: 1
    Last Post: July 20th, 2010, 09:20 AM
  2. visualtable's hottime and old machines
    By cbrogliato in forum Client SDKs
    Replies: 6
    Last Post: May 8th, 2010, 09:14 PM
  3. Replies: 3
    Last Post: January 21st, 2010, 12:25 PM
  4. Error with VisualTable
    By tuongkha in forum Client SDKs
    Replies: 19
    Last Post: July 8th, 2008, 09:16 AM
  5. VisualTable = How to capture value?
    By bayu in forum Client SDKs
    Replies: 1
    Last Post: December 17th, 2007, 10:14 AM

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 09:39 PM.