Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Feb 2011
    Posts
    104
    Vote Rating
    0
    headkit is on a distinguished road

      0  

    Default Unanswered: how to display csv data

    Unanswered: how to display csv data


    hi there!

    what is the best way to read and display some data from a csv data source. lets say I want to display an apple financial report with touch charts...

    thnx!

  2. #2
    Sencha User
    Join Date
    Nov 2010
    Posts
    168
    Vote Rating
    0
    philogb is on a distinguished road

      0  

    Default


    Hi - Unfortunately there is no buil-in CSV reader in Sencha Touch. I would try to convert the CSV string into JSON and then feed that into a Store. Given a CSV string with `\n` and `,` separators the code for converting it into JSON would eb something like this:

    Code:
    var json = [],
          lines = csv.split('\n');
    
    for (var i = 0, l = lines.length; i < l; ++i) {
      var fields = lines[i].split(','),
            jsonElement = {};
    
      jsonElement['field1'] = fields[0];
      jsonElement['field2'] = fields[1];
      //... etc for each field
    
      json.push(jsonElement);
    
    }
    This code should return the json needed to create a store with it.

    I hope his helps,

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi