var cellEditing=Ext.create("Ext.grid.plugin.CellEditing",{clicksToEdit:1});Ext.define("ICTest.view.RESTMeasureMappingGrid",{extend:"Ext.grid.Panel",requires:["Ext.selection.CellModel","Ext.selection.CheckboxModel"],alias:"widget.restMeasureMappingGrid",id:"restMeasureMappingGridObj",name:"restMeasureMappingGridObj",layout:{type:"vbox",align:"stretch"},ui:"newGridPanel RestColumnGrid paramGrid",margin:"10 20 20 20",flex:1,autoScroll:true,width:550,viewConfig:{deferEmptyText:false},emptyText:'<table width="100%" height="10px" style="margin:0% auto"><tr><td align="center" valign="middle"><div class="iconExclamation"></div><div style="margin:6px auto">'+screenLabelsObj["No_Params_Available"]+"</div></td></tr></table>",initComponent:function(){this.selModel=new Ext.selection.CheckboxModel({checkOnly:true,headerWidth:33,injectCheckbox:0});
this.getStore();this.columns=[{text:screenLabelsObj["measValLbl"],dataIndex:"key",width:150,editor:{allowBlank:false}},{text:screenLabelsObj["measInternvalValLbl"],dataIndex:"value",flex:1,editor:{allowBlank:false}},{header:'<div class="iconDeleteAll" style="margin:0px auto 0px auto" data-qclass="yellowTip" data-qtip="'+toolDeleteAll+'"></div>',xtype:"actioncolumn",enableColumnHide:false,menuDisabled:true,renderer:function(b,a){a.tdAttr='data-qclass=yellowTip data-qtip="'+toolDelete+'"';
return b;},width:55,sortable:false,tdCls:"restGridColumnCenter",items:[{iconCls:"iconDelete",handler:function(b,d,a){var c=b.getStore().getAt(d);b.store.remove(c);}}],listeners:{"headerclick":function(c,b,d,k,f){var a=this.up("grid"),g=a.getStore(),j=a.getSelectionModel(),i=g.getCount();if(i>0){var h=j.getSelection();
if(h.length==0){Ext.Msg.show({title:icTestAlertHeaderMsg,msg:screenLabelsObj["deleteParamAlert"],buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});return;}Ext.Msg.show({title:icTestAlertHeaderMsg,msg:screenLabelsObj["deleteSelectedParams"],buttons:Ext.Msg.YESNO,icon:Ext.Msg.QUESTION,fn:function(l){if(l=="yes"){var m=(a.selModel.selected.getCount()===a.getStore().getCount());
if(m){g.remove(h);}else{for(var e=0;e<h.length;e++){g.remove(h[e]);}}a.selModel.toggleUiHeader();}}});}else{Ext.Msg.show({title:icTestAlertHeaderMsg,msg:screenLabelsObj["No_Params_Available"],buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});return;}}}}];this.callParent();},plugins:[cellEditing],store:Ext.create("Ext.data.ArrayStore",{fields:[{name:"key",type:"string"},{name:"value",type:"string"}],data:[],selModel:{selType:"cellmodel"},storeId:"Grid1"}),});
