creazyboy
|
|
« on: July 04, 2014, 01:02:55 AM » |
|
How to change editor type dynamically according to some conditions!
The attachment is the screenshot!
Code as follows:
<div id="southDe" class="southDe"> <table id="dg" class="easyui-datagrid" title="" data-options=" width:450, height:330, top:0, singleSelect:true, url: '../ajax?sid='+threadSID+'&cmd=PCPM_GET_FILERTDETAIL&fuuid='+fUUID, method: 'post', hideColumn:'UUID', toolbar:[{ text:'新建', iconCls:'icon-add', handler:function(){appendFilterDetail();} },'-',{ text:'删除', iconCls:'icon-remove', handler:function(){removeFilterDetail();} },'-',{ text:'保存', iconCls:'icon-save', handler:function(){sureFilterDetail();} },'-',{ text:'取消', iconCls:'icon-undo', handler:function(){cancelFilterDetail();} }] "> <thead> <tr> <th data-options="field:'LOGIC',width:60,halign:'center',align:'center',editor:'text',formatter:function(value,row){return formatLogic(value,row);}">逻辑</th> <th data-options="field:'FIELD',width:80,align:'center',editor:'text',formatter:function(value,row){return formatField(value,row);},editor:{type:'combobox',options:{url:'../ajax?sid='+threadSID+'&cmd=PCPM_GET_FIELDS&id=&type='+type,valueField:'id',textField:'name',method:'post',required:true,onSelect:function(row){formatFieldType(row);}}}">参数</th> <th data-options="field:'CONDITION',width:100,align:'center',editor:'text',formatter:function(value,row){return formatCondition(value,row);},editor:{type:'combobox', options: { data: condition, valueField:'id',textField:'text',method:'post',required:true,onSelect:function(row){formatMaxValueEditor(row,this);}}}">条件</th> <th data-options="field:'VALUE',width:80,align:'center',editor:{type:'text'}">值</th> <th data-options="field:'MAXVALUE',width:80,align:'center',editor:'text'">最大值</th> <th data-options="field:'UUID',width:10,align:'center',hidden:true,editor:'text'">过滤器详情编码</th> </tr> </thead> </table>
When the datagrid in the editing status, I want to change the editor type of 'VALUE' according to 'FIELD' ! For examples, when the type of field selected is date, the editor type of 'VALUE' maybe datebox,when the type of field selected is dictionary, the editor type of 'VALUE' maybe combobox,How to achieve to this goal!
Thanks very very much!
|