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

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar