Aplogies for a long post. This is a continuation of the question:
Extjs adding multiple items to a window does not work
In the question, I had a grid defined like this:
var updater = msgDetailsPanel.getUpdater();/*Added new*/
var detailGrid = new Ext.grid.GridPanel({
id:'detailGrid',
store: dataStore,
collapsible: false,
columnLines: false,
enableHdMenu: false,
header: false,
cm: new Ext.grid.ColumnModel({
defaults: {
sortable: true
},
{id:'msgId',hidden: true, dataIndex: 'msgId'},
{sortable: true, dataIndex: 'deliveryAddr'},
{sortable: true, dataIndex: 'deliveryDate'},
{sortable: true, dataIndex: 'status', renderer:function(value, p, record){
return String.format( '<font color="009966">{0}</font>', value );}},
{header: 'info',xtype: 'templatecolumn',tpl: '<a href="#" onClick = "alert({msgId})">View Message Details</a>'}
]
}),
viewConfig: {
forceFit:true
},
columnLines: false,
frame:false,
collapsible: false,
animCollapse: false,
title: alertName,
disableSelection: true,
deferRowRender:false
});
I wish to replace onClick = "alert({msgId})" with onClick = "updater.update({msgId})" So that on click of the hyperlink ‘View Message Details’, the Panel will be populated with the msgId.
But I get:
javascript error: this.ds.fields.get(...).name is null or not an object.
How can i accomplish this?
Since your ID (‘msgId’) is hardcoded, I suggest a simple tack: