EasyUI Forum
October 16, 2025, 04:10:37 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: Datagrid Inline edit: show/hide editors dynamically  (Read 11335 times)
rangaNadha
Jr. Member
**
Posts: 50


View Profile
« on: November 18, 2015, 10:40:32 PM »

Hi,

How can we show/hide cell editors in the datagrid based on change comobo box in another cell, while inline editing?
Can any one provide an example?



Thanks in advance.
« Last Edit: November 18, 2015, 10:49:21 PM by pandutatikonda » Logged
jarry
Administrator
Hero Member
*****
Posts: 2300


View Profile Email
« Reply #1 on: November 18, 2015, 11:55:19 PM »

When begin to edit a row, the 'onBeginEdit' event fires, in which you can get all the editors and attach all events on them. Please refer to the code below:
Code:
$('#dg').datagrid({
onBeginEdit: function(index,row){
var dg = $(this);
var ed1 = dg.datagrid('getEditor', {index:index,field:'productid'});
$(ed1.target).combobox({
onChange: function(value){
var ed2 = dg.datagrid('getEditor', {index:index,field:'listprice'});
// $(ed2.target).numberbox('disable');  // disable the editor
$(ed2.target).parent().hide();  // hide the editor
}
})
}
})
Logged
rangaNadha
Jr. Member
**
Posts: 50


View Profile
« Reply #2 on: November 19, 2015, 06:16:07 AM »

Thanks for the response.

But, after adding that code. In the edit mode combobox is showing empty. It is not showing the previous saved value.

Is this happening because of  "$(ed1.target).combobox({"


Logged
rangaNadha
Jr. Member
**
Posts: 50


View Profile
« Reply #3 on: November 20, 2015, 05:20:05 AM »

I fixed it, after adding the onchange function. Manually i set the previous value. Now it is working fine. Thnx Jerry.
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!