EasyUI Forum
April 26, 2024, 12:05:18 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: Chain Combo Inline editor (2) [Solved]  (Read 13985 times)
mephisto
Newbie
*
Posts: 8


View Profile
« on: August 16, 2013, 07:26:59 AM »

Hi all,
I'm a newbie so sorry in advance for the probably silly question:

I've tried to use the code explained in the topic http://www.jeasyui.com/forum/index.php?topic=559.0 about the chained combobox (city/country) but I don't understand what is and how to use the parameter "idx" in:
Code:
onChange:function(value){
// get the country editor
var ed = $('#dg').datagrid('getEditor',{index:idx,field:'country'});
// reload its data
$(ed.target).combobox('reload','get_data.php?city='+value);

And how to pass in get_data.php the "value".

Thanks in advance.
« Last Edit: August 24, 2013, 01:37:28 PM by mephisto » Logged
chrwei
Full Member
***
Posts: 219


View Profile Email
« Reply #1 on: August 21, 2013, 02:01:24 PM »

you might find the linked example in the documentation more clear.  it also shows the json format expected.  http://www.jeasyui.com/documentation/index.php#
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #2 on: August 21, 2013, 05:54:34 PM »

Try the code below to get the current editing row index.
Code:
onChange:function(value){
var idx = $(this).closest('tr.datagrid-row').attr('datagrid-row-index');
// get the country editor
var ed = $('#dg').datagrid('getEditor',{index:idx,field:'country'});
// reload its data
$(ed.target).combobox('reload','get_data.php?city='+value);
}
Logged
mephisto
Newbie
*
Posts: 8


View Profile
« Reply #3 on: August 24, 2013, 12:18:12 PM »

Perfect!
your code solved the problem!
« Last Edit: August 24, 2013, 01:38:10 PM by mephisto » 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!