EasyUI Forum
May 22, 2024, 11:42:37 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 show data when update form?  (Read 6496 times)
deib97
Newbie
*
Posts: 9


View Profile Email
« on: March 07, 2016, 11:52:30 PM »

Hi,

I have form add, with dropdown on change to other dropdown.
Success for add. When update why not show data on dropdown?
Source when add :
$data['content']="<script type='text/javascript'>
    $('#id_group_users').combogrid({
               
            panelWidth:270,
                                width:300,
            url: 'template/json/combogrid/cb_group_users.php',
            idField:'id',
            textField:'group_users',
            mode:'remote',
   
            fitColumns:true,
            columns:[[
                       
               {field:'group_users',title:'Group Users',align:'left',width:140},
                  
            ]],
                               
                onChange:function(newValue,oldValue){
                    var modul=$('#id_module').combogrid('getValue');
                    $('#id_menu').combogrid({
                      panelWidth:370,
                                width:300,
                      url: 'template/json/combogrid/cb_menu.php?level='+newValue+'&modul='+modul,
                      idField:'id_menu',
                      textField:'ordered',
                      mode:'remote',
                                fitColumns:true,
                      columns:[[
                         {field:'id',title:'Kode',width:50,align:'center'},
                         {field:'nm_menu',title:'Nama Menu',align:'left',width:160},
                                        {field:'no_urut',title:'No Urut',align:'left',width:50},
                      ]]
                    });
                    }
    });

// how to show to #id_menu when update?
    $('#id_menu').combogrid({
            panelWidth:270,
                                width:300,
    });
    $('#status_aktif').combobox({
       panelHeight:'auto'
        });
      $('#id_module').combogrid({
               
            panelWidth:270,
                                width:300,
            url: 'template/json/combogrid/cb_module.php',
            idField:'id',
            textField:'module',
            mode:'remote',
                                fitColumns:true,
            columns:[[
                       
               {field:'id',title:'Kode',width:50,align:'center'},
               {field:'module',title:'Module',align:'left',width:160}
            ]]
    }); 
    </script>";
Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #1 on: March 08, 2016, 02:03:46 AM »

Here is your code:
Code:
$('#id_menu').combogrid({
  panelWidth:370,
  width:300,
  url: 'template/json/combogrid/cb_menu.php?level='+newValue+'&modul='+modul,
  idField:'id_menu',
  textField:'ordered',  // is it correct?
  mode:'remote',
  fitColumns:true,
  columns:[[
     {field:'id',title:'Kode',width:50,align:'center'},
     {field:'nm_menu',title:'Nama Menu',align:'left',width:160},
     {field:'no_urut',title:'No Urut',align:'left',width:50},
  ]]
});

The 'textField' value is 'ordered'. Please confirm whether the 'textField' property value is set correctly.
Logged
deib97
Newbie
*
Posts: 9


View Profile Email
« Reply #2 on: March 16, 2016, 07:57:51 PM »

Thanks jarry , Solved.
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!