加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-16 21:47:04 所属栏目:百科 来源:网络整理
导读: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,inRo

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读