Select json.email from store where json.id is 32323?
The statement will not be under that grid, callback, selection etc. But in a complete different place.
I have tried:
rowsSelected = isemriGrid.getSelectionModel().getSelections();
aRecord = rowsSelected[0];
console.log(aRecord.get('EMAIL')); //prints undefined
I think it doesn't print because EMAIL is not defined in the grid.开发者_运维技巧
I can get the ID. Using the ID, can I get the EMAIL from the store/json?
Surely you'd just want something like this:
rowsSelected = isemriGrid.getSelectionModel().getSelections();
aRecord = rowsSelected[0];
var theEmail = aRecord.data.EMAIL;
Presuming that the row you've got from the grid contains a data field called email.
If you don't have the email defined in the row and you want to get the value from the store, assuming aRecord.data.id = 12345 (or whatever id you want), you'd use the following:
rowsSelected = isemriGrid.getSelectionModel().getSelections();
aRecord = rowsSelected[0];
var theStoreRecord = isemriGrid.getStore().getById(aRecord.data.id);
var theEmail = theStoreRecord.data.EMAIL;
Does that help?
精彩评论