2

EDIT: the answer is to use a formatter function (see below)

If you have a data store something like this:

 var store = new Store({
    data: [
        { id: 1, username:  {first: 'John', last: 'Doe'},  
          score: 130, city: 'New York', birthday: '1980/2/5'}
    ]
});

Is there a way to tell GridX to reference username.first in a structure something like this? (this doesn't work, but is there a way to do this?)

var columns = [
  {field: 'username.first', name: 'Name'}
];

ANSWER:

var columns = [
    {name: 'Name', field: 'username',  
        formatter: function(rowData) {
          return rowData.username.first;
        }
    }
];
Danubian Sailor
  • 1
  • 38
  • 145
  • 223
rayduels
  • 83
  • 1
  • 5

0 Answers0