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); });
,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); }原文链接:https://www.f2er.com/dojo/291670.html