我正在使用IBM Content Navigator 2.0.3,它使用DOJO 1.8进行GUI开发。我是dojo中的新手,我必须增强其中一种形式:向dataGrid
添加事件处理程序,以便在选中某个网格的某一行时启用其中一个按钮。dojo datagrid事件附加问题
dataGrid
在HTML描述如下:
<div class="selectedGridContainer" data-dojo-attach-point="_selectedDataGridContainer">
<div class="selectedGrid" data-dojo-attach-point="_selectedDataGrid" ></div>
</div>
和控制该形式行为JS文件在postCreate
功能提到这个_selectedDataGrid
只有一次,:
postCreate: function() {
this.inherited(arguments);
this.textDir = has("text-direction");
this.hoverHelpList = [];
domClass.add(this._selectedDataGridContainer, "hasSorting");
this._renderSelectedGrid();
_renderSelectedGrid()
正在执行,其中仅包括:
_renderSelectedGrid: function() {
.......
this._selectedDataGrid.appendChild(this._selectedGrid.domNode);
我一直在努力,在HTML中添加数据道场 - 附加事件onRowClick: enableRemoveUsersButton
和
enableRemoveUsersButton: function(evt){
this.removeUsersButton.set('disabled', true);
},
在js文件
。没有帮助。
然后我尝试:
dojo.connect(myGrid, "onRowclick", function update() {
this.removeUsersButton.set('disabled', true); });
但使用我不能获得myGrid
对象:
`var myGrid = dojo.byId("_selectedDataGrid");`
谁能告诉我如何获得网格对象和/或添加一个事件处理这个网格,当网格的行被选中时触发?
谢谢!