EasyUI Forum
April 19, 2024, 02:43:47 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: Change Combobox Filter options in Datagrid dynamically  (Read 7994 times)
rangaNadha
Jr. Member
**
Posts: 50


View Profile
« on: March 04, 2018, 11:32:03 PM »

Hi,

We have a requirement saying that Enable/Disable the options in combo box filter dynamically for a datagrid on selecting a radio button outside the datagrid.

Could you Please tell me the process how to do that.

Thanks in Advance.

Thanks,
Pandu Ranga T.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: March 05, 2018, 07:22:16 AM »

Set the 'editable' property to true to enable the filter or false to disable it.
Code:
$('#cc').combobox({
  editable: true  // or false
});
Logged
rangaNadha
Jr. Member
**
Posts: 50


View Profile
« Reply #2 on: March 05, 2018, 09:59:04 PM »

Hi Jarry,

Its not the enable/disable the filter for a particular combobox.

We have to enable/disable the option in the combobox based on a radio button selection.

Code:

{
 field:'column',
 type:'combobox',
 options:{
panelHeight:'auto',
data:[
   {value:'',text:$("#all").text()},
   {value:'01',text:$("#confirmed").text()},
   {value:'02',text:$("#waitList").text()},
   {value:'03',text:$("#cancelled").text(), disabled: true}, // We need to change disabled attribute onSelecting a radio button outside the grid.
   {value:'04',text:$("#checkedIn").text()},
   {value:'06',text:$("#open").text()}
  ]
}
}


Thanks in advance.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #3 on: March 06, 2018, 02:26:35 AM »

Please try to call the 'getFilterComponent' method to get the filter component and load new data.
Code:
var data = [
{value:'',text:$("#all").text()},
{value:'01',text:$("#confirmed").text()},
{value:'02',text:$("#waitList").text()},
{value:'03',text:$("#cancelled").text(), disabled: true},
{value:'04',text:$("#checkedIn").text()},
{value:'06',text:$("#open").text()}
];
var dg = $('#dg');
var c = dg.datagrid('getFilterComponent', 'column');
c.combobox('loadData', data);
Logged
rangaNadha
Jr. Member
**
Posts: 50


View Profile
« Reply #4 on: March 06, 2018, 10:20:26 PM »

Thanks Jarry, it satisfied our requirement.
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!