Results 1 to 10 of 10

Hybrid View

  1. #1
    Senior Member
    Join Date
    Oct 2007
    Location
    HoChiMinh
    Posts
    69
    Hi Dario,
    I sorry about inconvenient, because HoChiMinh's Stock Exchange (VietNam) has trading hour (open stock market) from 8:30 AM to 11:00 AM (GMT +7), if u access in this time, u can see my site how is working? after close time, my site just only show trading results.

    1. I fixed error the values that come as "NaN" from the Server (i hidden it).
    2. I tried to set the "backgroundColor" instead of the "color" attribute, but it doesn't effect.

    Here my changed --> http://www.gls.com.vn:8080/priceonline/test.htm
    -------
    function formatValues(item, itemUpdate, itemName)
    {
    ...
    var backC = null;
    var backH ="#636363";
    itemUpdate.setRowAttribute(backH,backC,"background ");

    if (illuminate)
    {
    itemUpdate.setRowAttribute(backH,backC,"background Color");
    }

    //choose the "change" field stylesheet
    var newChng = itemUpdate.getFormattedValue("_change");

    if (newChng == null) return;
    if (newChng != null)
    {
    var hotTxtCol = (newChng.charAt(0) == '-') ? "#F70033" : "#2EFF00";
    if (newChng.indexOf("-") > -1)
    {
    itemUpdate.setAttribute("_change","black",hotTxtCo l,"color");
    itemUpdate.setAttribute("last_price","black",hotTx tCol,"color");
    itemUpdate.setAttribute("lastVol","black",hotTxtCo l,"color");
    }
    else
    {
    itemUpdate.setAttribute("_change","black",hotTxtCo l,"color");
    itemUpdate.setAttribute("last_price","black",hotTx tCol,"color");
    itemUpdate.setAttribute("lastVol","black",hotTxtCo l,"color");

    }
    if (newChng == 0)
    {
    itemUpdate.setAttribute("_change", "black", "#FFFF00", "color");
    itemUpdate.setAttribute("last_price", "black", "#FFFF00", "color");
    itemUpdate.setAttribute("lastVol", "black", "#FFFF00", "color");

    }

    itemUpdate.setAttribute("_change","bold","bold","f ontWeight");
    itemUpdate.setAttribute("last_price","bold","bold" ,"fontWeight");
    itemUpdate.setAttribute("lastVol","bold","bold","f ontWeight");
    }//end of if (newChng != null)

    if (newChng.indexOf("-") > -1)
    {
    itemUpdate.setFormattedValue("up_down",imgDown);
    }
    else
    {
    itemUpdate.setFormattedValue("up_down",imgUp);
    }
    if (newChng == 0)
    {
    itemUpdate.setFormattedValue("up_down",imgNochange );
    }

    //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)


    ////format the "number" fields
    for (var i = 1; i <= 35; i++)
    {
    var newValue = itemUpdate.getFormattedValue(i);
    if (newValue == null) continue;

    if (isNaN(newValue))
    {
    // ATO, ATC
    continue;
    }
    // neu field co gia tri = 0 thi ko hien thi zero
    if (newValue == 0)
    {
    itemUpdate.setFormattedValue(i,"");
    continue;
    }

    // var formattedVal = parseFloat(newValue);
    // itemUpdate.setFormattedValue(i,formattedVal);

    } //end of for (var i = 1; i <= 35; i++)


    var PriceRe=parseFloat(itemUpdate.getServerValue("ref_ price"));
    //format bid
    for (var i=4;i<=9;i+=2)
    {
    //Lenh ATO, ATC
    if (isNaN(itemUpdate.getServerValue(i)))
    {
    itemUpdate.setAttribute(i,"#FFFFFF","#FFFFFF","bac kgroundColor");

    itemUpdate.setAttribute(i+1,"#FFFFFF","#FFFFFF","b ackgroundColor");
    }

    else if (cf(itemUpdate.getServerValue(i))==PriceRe)
    {
    itemUpdate.setAttribute(i,"#FFFF00","#FFFF00","bac kgroundColor");
    itemUpdate.setAttribute(i+1,"#FFFF00","#FFFF00","b ackgroundColor");
    }
    else if (cf(itemUpdate.getServerValue(i))<PriceRe)
    {
    itemUpdate.setAttribute(i,"#F70033","#F70033","bac kgroundColor");
    itemUpdate.setAttribute(i+1,"#F70033","#F70033","b ackgroundColor");
    }
    else if (cf(itemUpdate.getServerValue(i))>PriceRe)
    {
    itemUpdate.setAttribute(i,"#2EFF00","#2EFF00","bac kgroundColor");
    itemUpdate.setAttribute(i+1,"#2EFF00","#2EFF00","b ackgroundColor");
    }
    }
    //end of for (var i=4;i<=9;i+=2)
    ...
    }

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    Actually, but for a few times (not today), we cannot access to your server at all in GMT+2 office time.
    However, also in this case, the use of the APIs is correct and the setting works if tested on our side.
    Could you reproduce a similar problem by starting from the StockListDemo in the distribution and performing just a few little changes?

  3. #3
    Senior Member
    Join Date
    Oct 2007
    Location
    HoChiMinh
    Posts
    69
    Hi Dario,
    Could you reproduce a similar problem by starting from the StockListDemo in the distribution and performing just a few little changes?
    No, I'm starting from "LS StockList Grid Demo" --> http://app.lightstreamer.com/GridDemo/ (not from StockListDemo in the distribution), and performing just a few little changes.

    By the way, I finish modified from StockListDemo sample (using NonVisualTable) --> http://www.gls.com.vn:8080/priceonline/hose.html --> Thanks for your help.

    After that, it always has 100% CPU when you first load the page, so I using VisualTable to performance. Here my performance version ---> http://www.gls.com.vn:8080/priceonline/test.htm --> I need your help.

    Can you access my server today? Sometime, maybe my server shutdown, if u can, please contact me by skype id : tuongkha or YM nickname : tuongkha2k. I will start my server.

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    Sorry, we cannot afford to setup direct interaction for forum support.

    About the formatting problem:
    Your changes to the GridDemo are big enough that we can't replicate the case and we cannot find anything wrong in the code snippet. Only if you can replicate a similar formatting problem on a slightly modified StockListDemo front-end, based on the original StockListDemo adapter, we could try to replicate it here.

    About the performance problem:
    Please try to replicate the problem after getting rid of the slider.
    If you just put a button on the page which calls "updateWInd(50)" do you still experience a delay of minutes? (we assume that you haven't modified the updateWInd function)
    We tried with 30 items in a page and could see a delay of a couple of seconds. It seems unlikely that the delay can increase 60 times on a smaller machine, but this cannot be excluded. Do you have a chance to test your page on a faster machine?

 

 

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 07:18 AM.