EasyUI Forum
June 15, 2024, 08:54:16 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: multiple combogrid in different Tabs (refresh combogrid)  (Read 6961 times)
madstudio
Newbie
*
Posts: 8


View Profile
« on: September 13, 2015, 08:34:47 PM »

Hello, first time in this forum,
I've made a very nice easyUI application, however there is one very last thing I can't get accomplished.

I have dependent combogrids in different tabs. When the application launch, they load the external json tables and this is fine, but the problem is when there is a change in one table, the combogrids doesn't refresh properly in the other tabs.

How can I refresh the combogrids?
Thank you/
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: September 14, 2015, 12:27:18 AM »

How do you create the dependent combogrid components? Please show some code snippets to describe your issue.
Logged
madstudio
Newbie
*
Posts: 8


View Profile
« Reply #2 on: September 14, 2015, 11:30:29 AM »

How do you create the dependent combogrid components? Please show some code snippets to describe your issue.

Thank you for your answer.
Actually I didn't do anything fancy:

1- First I have a few tabs like the demo:
class="easyui-tabs"

2- In each Tab, I have one Basic CRUD Application loading external JSON data like the demo:
class="easyui-datagrid"

3- In each Basic CRUD Application, I have filters with combogrids like the demo:
<span>By User:</span>
           <input id="users" class="easyui-combogrid"  style="width:120px" data-options="
            panelWidth: 250,
            url: 'http://www.URLEXAMPLE/get_users.php',
            idField: 'username',
            valueField: 'username',
            textField: 'username',
            mode:'remote',
            columns:[[
                      {field:'username',title:'Sort:',width:192,sortable:true}
                    ]]" >

The problem is, any update I do to any BASIC CRUD Application, will not update the filters combogrid in the other Tabs unless you 1- Refresh the entire webpage 2 - Sort by name if you make it sortable:true, 3 -drop down twice the dropdown combogrid.

I am looking for a way to update combogrid like this for datagrid: $('#EXAMPLE').edatagrid('reload');
« Last Edit: September 14, 2015, 11:36:14 AM by madstudio » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: September 14, 2015, 05:29:00 PM »

The datagrid in the tab panel and the combogrid do not use the same datasource. To refresh the combogrid, you have to get the datagrid bound to the drop-down panel and then call 'reload' method on it.
Code:
var grid = $('#users').combogrid('grid');
grid.datagrid('reload');
Logged
madstudio
Newbie
*
Posts: 8


View Profile
« Reply #4 on: September 14, 2015, 06:13:51 PM »

you are awesome!
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!