EasyUI Forum
September 14, 2025, 01:50:48 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: Using combogrid in a datagrid cell  (Read 17527 times)
sherzodr
Newbie
*
Posts: 1


View Profile
« on: February 27, 2014, 12:21:55 AM »

Hi,

I grew comfortable with using datagrid and combogrid. But now I'm trying to use combogrid in a cell of an editable datagrid. Anyone has tried it before?

Thank you!!!
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: February 27, 2014, 12:47:52 AM »

The 'combogrid' editor is not included in standard version, please extend it as below:
Code:
$.extend($.fn.datagrid.defaults.editors, {
combogrid: {
init: function(container, options){
var combo = $('<input type="text">').appendTo(container);
combo.combogrid(options);
return combo;
},
destroy: function(target){
$(target).combogrid('destroy');
},
getValue: function(target){
var opts = $(target).combogrid('options');
if (opts.multiple){
return $(target).combogrid('getValues').join(opts.separator);
} else {
return $(target).combogrid('getValue');
}
},
setValue: function(target, value){
var opts = $(target).combogrid('options');
if (opts.multiple){
if (value){
$(target).combogrid('setValues', value.split(opts.separator));
} else {
$(target).combogrid('clear');
}
} else {
$(target).combogrid('setValue', value);
}
},
resize: function(target, width){
$(target).combogrid('resize', width)
}
}
})
Logged
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« Reply #2 on: March 24, 2015, 04:01:41 AM »

I test this and it is not working on my side.
Can one help me to implement a combogrid in datagrid?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: March 24, 2015, 07:41:14 AM »

The combogrid editor has been integrated into the core package since version 1.3.6.
Logged
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« Reply #4 on: March 24, 2015, 08:40:03 AM »

OK. But it is not in the documentation of the datagrid page:
http://www.jeasyui.com/documentation/datagrid.php
« Last Edit: March 24, 2015, 08:42:59 AM by Stefan B. » Logged
thecyberzone
Full Member
***
Posts: 176



View Profile Email
« Reply #5 on: March 24, 2015, 08:58:42 AM »

Field declaration for combogrid may be written as follows:

Code:
{field:'secode2',title:'Section',width:100,align:'left',
editor:{
    type:'combogrid',
    options:{
    idField: 'secode2', textField: 'section',
url: 'getSection.php',
mode: 'remote',
fitColumns:true,
columns: [[
{field:'secode2',title:'SeCode',width:60,align:'right'},
{field:'secode',width:0,hidden:true},
{field:'section2',width:0, hidden:true},
{field:'section',title:'Section',width:260},
{field:'deptname',title:'Department',width:200}
]],
panelHeight:135
    }
}
}
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!