EasyUI Forum
May 03, 2024, 10:58:22 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: combotree can not form load in and setValue in?is it a bug?  (Read 7287 times)
cdtuql
Newbie
*
Posts: 26


View Profile Email
« on: January 02, 2015, 08:22:54 PM »

hi:
I use combotree in a form , when  i  use the form to modify the recorder ,I get the recorder from server,but  I can't load the combotree filed,but other field such as combobox field has no problem,and I  get the value and use setValue can't set combotree filed too;when I add
a alert("dd") before the setValue,I work!! is not a bug? the easyui version is 1.4.1

the below is not work:
 onLoad:function(){
          $('#dishes_disheseditform_form').form('load',rows[0]);        
         // $('#itemclassNo').combotree('setValue',rows[0].itemclassNo);
    }

the below when I confirm the alert,it work
   onLoad:function(){
        alert(rows[0].itemclassNo);
        $('#dishes_disheseditform_form').form('load',rows[0]);
  }
when I use the comboxtree setValue ,the result is the same
how can i do?it is cost my 2days to do this!!


my dialog is:
var node= $('#dishes_dishes_dishesclass_tree').tree('getSelected');
     if (node){
    var theItemId=getServerUUID(); 
    var d= $("<div />").dialog({
    width:800,
    height:600,
    modal:true,
    href:'${pageContext.request.contextPath}/dishes/DishesEditForm.jsp',
    title:'新增..',
    buttons:[{text:'保存',iconCls:'icon-save',plain:true,handler:function(){
        $('#dishes_disheseditform_form').form('submit', {
            url:'${pageContext.request.contextPath}/itemAction!add.action',
            queryParams:{
                     
                      itemId:theItemId,
                      onmenu:'1'
                    },
            success : function(r) {
                     var obj = jQuery.parseJSON(r);                     
                     if (obj.success) {
                        d.dialog('close');                        
                        $('#dishes_dishes_dishes_datagrid').datagrid('insertRow',{
                           index:0,
                           row:obj.obj
                        });
                        
                     }
                     $.messager.show({
                        title : '提示',
                        msg : obj.msg
                     });
                  }
               });
   
       
           }},{text:'取消',iconCls:'icon-cancel',plain:true,handler:function(){
                       d.dialog('close');}}],
    onLoad:function(){
       //对话框装载的时候,装载表单数据
       //设置默认选中url:'${pageContext.request.contextPath}/itemClassAction!getAllTreeNode.action'
       var node= $('#dishes_dishes_dishesclass_tree').tree('getSelected');
       //$('#itemclassNo').combotree('reload',node.id);
       //alert(node.id);
       $('#itemclassNo').combotree('setValues',[node.id]);
       
    },
    onClose:function(){
       $(this).dialog('destroy');
    }
   
    });   
and the form is:
        DishesEditForm.jsp'
   <form id="dishes_disheseditform_form" method="post">
      <div class="easyui-tabs" data-options="border:false"  >
         <div title="基本信息" data-options="fit:true,border:false">
            <table >
               <tr class="dgtbtr">
                  <td>xxxx</td>
                  
                  <td><input id="itemclassNo" name="itemclassNo"   class="easyui-combotree"
                     data-options="url:'${pageContext.request.contextPath}/itemClassAction!getAllTreeNode.action'" />
                  </td>
                  
                  
                   <td>yyyy</td>
                   <td align="left">
                        <select id="dishes_disheseditform_thetypecombox"  name="thetype" style="width:150px;" onchange="getDishesNo(this)" >
                                <option value="no"></option>
                                <option value="00">ttt</option>
                                <option value="01">tt2</option>
                      </select>
                   </td>
                                       </tr>
                            </table>
                       </div>
              </div>
      </form>
                  

« Last Edit: January 03, 2015, 04:28:41 AM by cdtuql » Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: January 03, 2015, 07:29:16 PM »

Please try to download the patch from http://www.jeasyui.com/download/downloads/jquery-easyui-1.4.1-patch.zip.
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!