Dojo DataGrid 控件的 onCellDblClick 事件的工作流程

jsp 代码:

			<!-- 数据列表 -->
			<div id="dataGrid" data-dojo-type="dojox.grid.EnhancedGrid"
					data-dojo-props='structure : manuPlanEntry.layout ,
					autoHeight : false,
					escapeHTMLInData : false,
					canSort : commonFunc.canSort,
					onStartEdit:function(inCell, inRowIndex){
						dijit.byId("applyEditButton").set("disabled",false);
					},
					onApplyEdit:function(){
						dijit.byId("applyEditButton").set("disabled",true);
					},
					onCancelEdit:function(){
						dijit.byId("applyEditButton").set("disabled",true);
					},
					style : "width: 100%; height: auto;",
					plugins : {
						indirectSelection : {
							headerSelector : true,
							name : "Selection",
							width : "60px",
							styles : "text-align: center;"
						}
					}'>
				</div>


	dojo.addOnLoad(function() {
		dojo.connect(dijit.byId("dataGrid"),"onCellDblClick",manuPlanEntry.onCellDblClick);

	});


js 代码:

		,onCellDblClick:function(evt){
			if(evt.target.cellIndex==3||evt.target.cellIndex==4){
				dojo.byId("itemSelect_handlerFunction").value = "manuPlanEntry.itemUpdateSelect_handler";
				dojo.byId("dataGridRowIndex").value=evt.rowIndex;
				itemSelect.show();
//				dijit.byId("addDlg").show();
			}
			if(evt.target.cellIndex==7){
				dojo.byId("deviceSelect_handlerFunction").value = "manuPlanEntry.deviceUpdateSelect_handler";
				dojo.byId("dataGridRowIndex").value=evt.rowIndex;
				deviceSelect.show();
			}
		
		}


		,itemUpdateSelect_handler: function(items ){
			var index=dojo.byId("dataGridRowIndex").value;
			var item=dijit.byId("dataGrid").getItem(index);
			dijit.byId("dataGrid").get("store").setValue(item, "itemId", items[0].id);
			dijit.byId("dataGrid").get("store").setValue(item, "itemName", items[0].name);
			dijit.byId("dataGrid").get("store").setValue(item, "itemHelpCode", items[0].helpCode);
			dijit.byId("dataGrid").get("store").setValue(item, "unitId", items[0].measureUnitId);
			dijit.byId("dataGrid").get("store").setValue(item, "unitName", items[0].measureUnit);
			
		}



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值