EasyUI Forum

General Category => Bug Report => Topic started by: dnhoang on July 08, 2014, 08:09:06 PM



Title: Edatagrid with datagrid filter plugin could not reload
Post by: dnhoang on July 08, 2014, 08:09:06 PM
Hello everyone!

I add a filter to my edatagrid by datagrid filter plugin and I could not reload it by pressing RELOAD button of pagination or even changing url of edatagrid. Can somebody help me?


Title: Re: Edatagrid with datagrid filter plugin could not reload
Post by: jarry on July 09, 2014, 02:34:46 AM
Please try to download the newest 'datagrid-filter.js' file from http://www.jeasyui.com/extension/datagrid_filter.php


Title: Re: Edatagrid with datagrid filter plugin could not reload
Post by: dnhoang on July 11, 2014, 12:39:46 AM
Dear Jarry!

I'm using the newest file, not only "datagrid-filter.js" but all js files of easyui.  it's OK if I remove edatagrid plugin. I'm trying many ways but it does not work.


Title: Re: Edatagrid with datagrid filter plugin could not reload
Post by: jarry on July 11, 2014, 01:19:58 AM
Please see this example http://jsfiddle.net/L7CkY/. It works fine.


Title: Re: Edatagrid with datagrid filter plugin could not reload
Post by: dnhoang on July 15, 2014, 11:26:15 PM
Sorry Jarry! But it works well until I add pagination, and I could not reload. You can add pagination and reload, or add a button to reload it, you will see my status. Please note that with reload button, it seems working but it does not update new data, just like refreshing current data. I am trying to find some method.


Title: Re: Edatagrid with datagrid filter plugin could not reload
Post by: dnhoang on July 22, 2014, 08:30:00 PM
Thanks Jarry! I have just updated file datagrid-filter.js and it works fine.
But there is still a small problem. After change data url, I have to call reload method to get new data. Could you make datagrid not to load data at the beginning? because data is too heavy, and I want to load grid first, then I will load my data by change url.


Title: Re: Edatagrid with datagrid filter plugin could not reload
Post by: jarry on July 22, 2014, 11:33:02 PM
Please do not set the 'url' property, the datagrid will have no rows when created. Once you want to load data, set 'url' property and call 'reload' method.
Code:
var dg = $('#dg').datagrid({
  url: null
});
// now load data
dg.datagrid('options').url = ...;
dg.datagrid('reload');


Title: Re: Edatagrid with datagrid filter plugin could not reload
Post by: dnhoang on July 23, 2014, 07:07:14 PM
Thanks jarry, it works like my hope.
But when I use (dg.datagrid({url:...})), grid will also load data.
What is the difference between above syntax and (dg.datagrid('options').url = ...;)?