EasyUI Forum
July 05, 2024, 07:38:25 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / EasyUI for jQuery / easyui treegrid lazyload cannot select one row or fire the onclickcell event! on: July 11, 2014, 12:38:26 AM
HI,Now I'm using the treegrid lazyload data level by level . When the second level load its children nodes ,the data can display,But it cannot fire the onclickcell event .And here are the errors in the error console :
Uncaught TypeError: Cannot read property 'CUSTNAME' of null jquery.easyui.min.js:7910
(anonymous function) jquery.easyui.min.js:7910
x.event.dispatch jquery.min.js:5
x.event.add.y.handle

code as follows:

<table id="tree"  class="easyui-treegrid" title=""
         data-options="
            width:1180,
            height:510,
            top:-30,
            collapsible: true,
            animate:true,
            idField: 'ID',
            singleSelect:true,
            treeField: zdField,
            rowStyler:function(row){return changeColor(row);},
            onSelect:function(){refreshParentWin();},
            onBeforeExpand:function(row){return refreshParent(row);},
            onClickCell:onClickCell1
         ">
      <thead>
         <tr id="treeTr">
            <script type="text/javascript">
                  $('#treeTr').append(info);
            </script>
         </tr>
      </thead>
   </table>
   <script>
      $(function(){
         var data = synchronizezRequest(url);
         var object = eval("(" + data + ")");
         var rows = object.rows;
         $('#tree').treegrid('loadData', object);
        });
   </script>


function refreshParent(row)
{
   var url = "";
   var keyWord = "";
   if(parent.document.getElementById('custTextButton4').value != null)
   {
      keyWord =parent.document.getElementById('custTextButton4').value;
   }
   if(row)
   {
      url = '../ajax?sid='+threadSID+'&cmd=PCPM_APPLY_FILTER&uuids='+filterUUIDs+'&type='+type+'&keyword='+keyWord+'&field='+zdField+'&parentid='+row.ID;
   }
   else
   {
      url = '../ajax?sid='+threadSID+'&cmd=PCPM_APPLY_FILTER&uuids='+filterUUIDs+'&type='+type+'&keyword='+keyWord+'&field='+zdField;
   }
   
   $("#tree").treegrid("options").url = url;
    return true;     
}


datajson like this:
{"rows":[
   {"id":1,"name":"All Tasks","begin":"3/4/2010","end":"3/20/2010","progress":60,"iconCls":"icon-ok"},
   {"id":2,"name":"Designing","begin":"3/4/2010","end":"3/10/2010","progress":100,"_parentId":1,"state":"closed"},
   {"id":21,"name":"Database","persons":2,"begin":"3/4/2010","end":"3/6/2010","progress":100,"_parentId":2},
   {"id":22,"name":"UML","persons":1,"begin":"3/7/2010","end":"3/8/2010","progress":100,"_parentId":2},
   {"id":23,"name":"Export Document","persons":1,"begin":"3/9/2010","end":"3/10/2010","progress":100,"_parentId":2},
   {"id":3,"name":"Coding","persons":2,"begin":"3/11/2010","end":"3/18/2010","progress":80},
   {"id":4,"name":"Testing","persons":1,"begin":"3/19/2010","end":"3/20/2010","progress":20}
]}

[
   {"id":1,"name":"All Tasks","begin":"3/4/2010","end":"3/20/2010","progress":60,"iconCls":"icon-ok"},
   {"id":2,"name":"Designing","begin":"3/4/2010","end":"3/10/2010","progress":100,"_parentId":1,"state":"closed"},
   {"id":21,"name":"Database","persons":2,"begin":"3/4/2010","end":"3/6/2010","progress":100,"_parentId":2},
   {"id":22,"name":"UML","persons":1,"begin":"3/7/2010","end":"3/8/2010","progress":100,"_parentId":2},
   {"id":23,"name":"Export Document","persons":1,"begin":"3/9/2010","end":"3/10/2010","progress":100,"_parentId":2},
   {"id":3,"name":"Coding","persons":2,"begin":"3/11/2010","end":"3/18/2010","progress":80},
   {"id":4,"name":"Testing","persons":1,"begin":"3/19/2010","end":"3/20/2010","progress":20}
]


please help me! thanks very much!
2  General Category / EasyUI for jQuery / How to change editor type dynamically according to some conditions 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!
3  General Category / EasyUI for jQuery / Re: Virtual Scrolling for TreeGrid on: July 03, 2014, 08:03:00 PM
Hi, I also have this problem. Does this problem solved?
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!