0

Guys, I'm quite new to extJS and I would like your help. I have this Grid.Panel with listeners, I don't know if i got it right. Anyway, I got it to print out its properties but I cant get the data. Here is what the console printed out.

Object { internalId=, raw={...}, data={...}, more...}

after clicking it:

see encircled in red

The "data" encircled in red. How do get those information? I believe inside "data" are the information to when I clicked the certain row.

sra
  • 23,820
  • 7
  • 55
  • 89
oneofakind
  • 552
  • 17
  • 41
  • are you binding this information to grid? or you want to access it and explicitly load it on the grid? – Mutant Sep 23 '12 at 06:49
  • 1
    It is hard to say what exactly your problem is... Do want to access fields of a record? Do you want to load records into a grid and show specific fields? – sra Sep 23 '12 at 08:44
  • I already loaded the data into the grid.Panel and with a listener I want to access the records in order to do another action. – oneofakind Sep 24 '12 at 00:18
  • 1
    The best answer here will depend on your next action, if for example you want to update a single record in a database, the approach would be very different than if you wanted to export the entire dataset to file for example. What is your goal? – dougajmcdonald Sep 24 '12 at 11:06

1 Answers1

1

You can add a load listener on the grid store as suggested by @sra and iterate over records to perform another operation.

gridStore().load({
    callback : function(records, operation, success) {
                 //Iterate over each record and get data from record
                 var name = records[0].get('name');
    }});
Kapil Gupta
  • 113
  • 1
  • 8