EasyUI Forum
May 18, 2024, 04:16:01 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: Accessing datagrid inline editors outside of the datagrid  (Read 5140 times)
devnull
Sr. Member
****
Posts: 431


View Profile
« on: March 24, 2016, 03:53:32 AM »

I have a datagrid that handles the rows in a header - row type document.

The datagrid row has inline editing with several comboboxes, numberspinners etc etc.

I know that I can acces an editor when there is a row already loaded by using getEditors(), but how can I access these combobox, numberspinner etc objects without referencing a particular row.

These objects have their properties including url and urlParams for json queries dynamically set by other comboboxes within a form on the same page and right now I can't figure out how to access them outside of the datagrid row ?


Logged

-- Licensed User --
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #1 on: March 24, 2016, 05:09:38 AM »

I have figured out how to get the combo object outside of the datagrid:

Code:
      var oid = $('#dgrid').datagrid('getColumnOption','ORDER_ID').editor;
      oid.combobox('reload','/?someurlandparams);

But how can I call the combobox and reload it ?


« Last Edit: March 24, 2016, 04:58:17 PM by devnull » Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #2 on: March 24, 2016, 11:34:51 PM »

You can change the configuration of the column editor. Just like this:
Code:
var oid = $('#dgrid').datagrid('getColumnOption','ORDER_ID').editor;
oid.options.url = '/?someurlandparams';

Or call 'reload' method when beginning to editor a row.
Code:
$('#dgrid').datagrid({
onBeginEdit: function(index,row){
var ed = $(this).datagrid('getEditor', {index:index,field:'ORDER_ID'});
$(ed.target).combobox('reload','/?someurlandparams');
}
});
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!