EasyUI Forum
April 25, 2024, 12:27:46 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: Edatagrid with datagrid filter plugin could not reload  (Read 12948 times)
dnhoang
Newbie
*
Posts: 11


View Profile
« 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?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 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
Logged
dnhoang
Newbie
*
Posts: 11


View Profile
« Reply #2 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.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #3 on: July 11, 2014, 01:19:58 AM »

Please see this example http://jsfiddle.net/L7CkY/. It works fine.
Logged
dnhoang
Newbie
*
Posts: 11


View Profile
« Reply #4 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.
Logged
dnhoang
Newbie
*
Posts: 11


View Profile
« Reply #5 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.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #6 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');
Logged
dnhoang
Newbie
*
Posts: 11


View Profile
« Reply #7 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 = ...Wink?
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!