EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: madstudio on September 13, 2015, 08:34:47 PM



Title: multiple combogrid in different Tabs (refresh combogrid)
Post by: madstudio 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/


Title: Re: multiple combogrid in different Tabs (refresh combogrid)
Post by: stworthy 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.


Title: Re: multiple combogrid in different Tabs (refresh combogrid)
Post by: madstudio 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');


Title: Re: multiple combogrid in different Tabs (refresh combogrid)
Post by: stworthy 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');


Title: Re: multiple combogrid in different Tabs (refresh combogrid)
Post by: madstudio on September 14, 2015, 06:13:51 PM
you are awesome!