This is the code snippet I have:
var records = Ext.data.Record.create([{name: 'msgId', type:'string', mapping: 'msgId'},]);
...
...
var detailGrid = new Ext.grid.GridPanel({
id:'detailGrid',
store: dataStore,
cm: new Ext.grid.ColumnModel({
columns: [
{id:'msgId',hidden: true, dataIndex: 'msgId'},
{header: 'info',xtype: 'templatecolumn',tpl: '<a href="#" onClick = "viewMessage(records)">View Message Details</a>'}
]
}),
When it comes to onClick = "viewMessage(records)", I get : 'records' is undefined.
What is wrong here?
EDIT:The solution given works to remove the error. But when I put in a function like this:
function viewMessage(records){
alert(Ext.util.JSON.encode(records));
}
I get {} as alert i.e. no data.
maybe something like this