EasyUI Forum
May 09, 2024, 06:11:02 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to change editor type dynamically according to some conditions  (Read 11374 times)
creazyboy
Newbie
*
Posts: 3


View Profile Email
« 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!
Logged
zurfero
Newbie
*
Posts: 15


View Profile
« Reply #1 on: September 12, 2014, 09:10:20 AM »

I have interested in your question..., I have the same issue..., but not find a solution yet.
Anybody can help us??
Is possible change editor dinamically???
Logged
A-K
Full Member
***
Posts: 122


View Profile WWW
« Reply #2 on: September 12, 2014, 12:52:59 PM »

Hey, maybe this thread I opened not long ago will help you. Its very similar.

http://www.jeasyui.com/forum/index.php?topic=3703.msg8525#msg8525
Logged
zurfero
Newbie
*
Posts: 15


View Profile
« Reply #3 on: September 14, 2014, 11:09:12 PM »

A-K, your answer it's 100% OK and solve the question..., THANK YOU VERY MUCH!!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!