1. #1
    Sencha User
    Join Date
    Jan 2013
    Posts
    13
    Vote Rating
    0
    Tremal is on a distinguished road

      0  

    Default Print a list of values in one cell

    Print a list of values in one cell


    Hi,

    I have a little problem. A JSON response has the next:

    [{"name":"Foo",
    "list":[{"name":"Boo","id":85}]
    }]


    And I want to load one grid panel. One column will have the name (works correctly) but the second column prints only [Object].

    how I must configura my JSON Object to print only the name field of the list?

    Thanks

  2. #2
    Sencha User
    Join Date
    Mar 2013
    Posts
    9
    Vote Rating
    0
    Mr.Solomon is on a distinguished road

      0  

    Default


    I think you need a render function in your column definition
    PHP Code:
    header:'colname'
    /*...*/
    dataIndex:'',//according to your  json field
    render:function(v){
              return 
    v.name 


  3. #3
    Sencha User
    Join Date
    Jan 2013
    Posts
    13
    Vote Rating
    0
    Tremal is on a distinguished road

      0  

    Default


    Hi Mr. Solomon

    Thanks about your suggestion. I had have to modify some details:

    PHP Code:
    header:'colname'
    /*...*/
    dataIndex:'',//according to your  json field
    renderer:function(vmetaDatarecordrowcolstoregridView){
              return 
    v[row].name 

    The problem is that prints only one element from the list.

    For example, this arrives to the page:

    [{"name":"Foo",
    "list":[{"name":"Boo","id":85},{"name":"Buu","id":86}]
    }]

  4. #4
    Sencha User
    Join Date
    Jan 2013
    Posts
    13
    Vote Rating
    0
    Tremal is on a distinguished road

      0  

    Default


    Hi! I'm solved:

    PHP Code:
    renderer : function(v)
    {
      var 
    result "";
      for (var 
    i=0;i<v.length;i++)
      { 
        
    result result " " v[i].name  }
      return 
    result; } 
    Thanks for your help Solomon

Thread Participants: 1

Tags for this Thread

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