EasyUI Forum
May 08, 2024, 10:22:55 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: Get Combogrid ID  (Read 9920 times)
finzaiko
Newbie
*
Posts: 44


View Profile
« on: December 18, 2013, 02:19:22 AM »

I tried to make combogrid in edatagrid with onChange remote searching base on topic
http://www.jeasyui.com/forum/index.php?topic=478.0
http://www.jeasyui.com/forum/index.php?topic=1580.msg3523#msg3523

when I reload callback data, how do I get the grid id combogrid ? actually we do not define the combogrid ID

Code:
var unitEditor = {
        type:'combogrid',
        options:{
                panelWidth:260,
                idField:'id',
                textField:'unit_name',
                mode:'remote',
                required:true,
                columns:[[
                        {field:'id',title:'id',width:60},
                        {field:'unit_name',title:'unit',width:200}
                ]],
                onSelect: onSelectGrid,
                onChange:function(value){
                       $('#???').datagrid('load',{ // how get current combogrid ID ???
                        find: value
                    });
                    console.log(value);
                },
                filter: function(q,row){
                        var opts = $(this).combogrid('options');
                        return row[opts.textField].toUpperCase().indexOf(q.toUpperCase()) >= 0;
                },
                data: itemList
        }
       
   

I appreciate and thanks for help.


Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: December 18, 2013, 03:39:01 AM »

Please call 'grid' method of combogrid to get datagrid object.
Code:
onChange:function(value){
$(this).combogrid('grid').datagrid('load',{ // how get current combogrid ID ???
find: value
});
console.log(value);
},
Logged
finzaiko
Newbie
*
Posts: 44


View Profile
« Reply #2 on: December 19, 2013, 02:02:06 AM »

Thanks stworthy, Its worked.
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!