|
Title: Datagrid does not reload data if it gets [] after one of reloads (1.4) Post by: mzeddd on September 14, 2014, 01:48:02 AM I have the following code
Code: var addr = 'test.php?state='+state; It works fine on 1.3.6 version. But with 1.4 no. Playing with "state" I could load something or nothing. Once I load empty data "[]" my datagrid stops showing any data even if I change "state" to new value when data exists. Title: Re: Datagrid does not reload data if it gets [] after one of reloads (1.4) Post by: jarry on September 14, 2014, 02:30:27 AM You may need to provide an example or a page link to demonstrate your issue.
Title: Re: Datagrid does not reload data if it gets [] after one of reloads (1.4) Post by: mzeddd on September 15, 2014, 02:21:35 AM I tried to build simplyfied example where I do the same as on my page where I have my problem.
But unfortunately for me it works :( I have added onLoadError event and it fires every time once I load no data. And continues to appear every time when I try to (re)load any data into my datagrid. When I say no data I mean the following string: Code: {"total":0,"rows":[]}Can you advice me what I should check? What could be the reason of onLoadError event? It works fine with 1.3.6 and other versions. It started to appear with 1.4. Thanks in advance. Title: Re: Datagrid does not reload data if it gets [] after one of reloads (1.4) Post by: mzeddd on September 15, 2014, 02:41:01 AM Would be good to add parameter to onLoadError which should describe reason of error.
Title: Re: Datagrid does not reload data if it gets [] after one of reloads (1.4) Post by: mzeddd on September 15, 2014, 03:20:38 AM It took some time to find out the reason of the problem.
1) About my question above which is Quote Would be good to add parameter to onLoadError which should describe reason of error. It seems like documentation for Datagrid is not completely correct, becase onLoadError has parameter which helps to understand the reason of the problem. But in documentation I see "none" 2) About my initial problem. Code: onLoadError: function(arguments){alert('Load error:'+arguments.responseText);}It happened because I expect $_POST['page'] to be above 0 if it is set. In my case $_POST['page'] was 0. I see $_POST['page'] set to zero when I load something, then load nothing and then try to load something again. Can you look into this two issues? Thanks Title: Re: Datagrid does not reload data if it gets [] after one of reloads (1.4) Post by: jarry on September 15, 2014, 04:34:48 AM Please try to download the patch from http://www.jeasyui.com/download/downloads/jquery-easyui-1.4-patch.zip. The 'page' parameter value will always be set to above 0.
Title: Re: Datagrid does not reload data if it gets [] after one of reloads (1.4) Post by: mzeddd on September 15, 2014, 04:42:38 AM Looks good.
Thanks |