2011-08-31 3 views
0

긴 게시물에 대한 애매시. 이 질문의 연속이다 : 질문에 Extjs adding multiple items to a window does not work , I는 다음과 같이 정의 그리드했다 : 나는 onClick = "alert({msgId})"onClick = "updater.update({msgId})"로 교체 할extjs에서 관리 iframe 패널 업데이트

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 
}); 

을 그래서 하이퍼 링크 '보기 메시지 세부 사항'의 클릭에, 패널에는 msgId가 채워집니다. 하지만받을 수 있습니다.

javascript error: this.ds.fields.get(...).name is null or not an object. 

어떻게하면됩니까?

Ext.onReady(function() 
{ 
    // When the DOM is ready, establish a handler (onClick) for the msgId node. 
    // Again, msgId is hardcoded - not certain why you would pass it as a parameter to updater - 
    // but createDelegate passes msgId as a parameter. 
    Ext.get('msgId').on('click', updater.update.createDelegate(this, [{msgId}], 0)) 
}); 

답변

0

사용자의 ID ('MSGID')가 하드이기 때문에

, 나는 간단한 압정을 제안? 감사합니다.
+0

안녕 ... 무슨 뜻 어떻게 ... "MSGID는 하드 코드" – Victor

+0

Ext.id를 사용하여 모든 DOM ID를 생성하고 싶습니다. 본질적으로 이는 DOM ID의 정확한 값을 신경 쓰지 않는 것을 의미합니다. Ext.id (null, 'something'). 그것은 또한 당신의 코드가 ID와 같은 것을 결코 가지지 않을 것이라는 것을 의미합니다 : 'IDId'- 하드 코드 된 ID. – Upperstage