Title: [FIXED] how can i clear the rows of datagrid Post by: wade.zhu on August 12, 2014, 02:20:10 AM i have a datagrid and a search form, when submit search form, i want to clear the previous results first, then load new data from remote.
i didn't find 'clear', 'reset' or something else in the docs i try to use loadData method to load empty data instead, like this: Code:
i found loadData method will trigger loader to load data from remote if opt.url is not empty it is not supposed to load remote data after loadData from local. is that a bug? or is there anyway to meet my requirement? Title: Re: how can i clear the rows of datagrid Post by: hjzhbb7758 on August 12, 2014, 02:55:59 AM hei,gay。where‘re you from /?
Title: Re: how can i clear the rows of datagrid Post by: aswzen on August 12, 2014, 03:16:28 AM try run this script..
Code: $('#your_table_id').datagrid('loadData', {"total":0,"rows":[]}); Title: Re: how can i clear the rows of datagrid Post by: wade.zhu on August 12, 2014, 07:38:15 PM i found a bug of datagrid when no data filled, see the code bellow
Code: <table class="easyui-datagrid" title="Basic DataGrid" style="width:700px;height:250px" _5d7(_60f); at line 8668 executed and loader will be called when loadData []. Code: var _614=$(_60f).datagrid("getPager"); Title: Re: how can i clear the rows of datagrid Post by: stworthy on August 12, 2014, 07:55:41 PM By default the 'pageNumber' property is set to 1, you can set it to 0 if the 'url' property is not defined.
Code: $('#dg').datagrid({ Title: Re: how can i clear the rows of datagrid Post by: wade.zhu on August 12, 2014, 08:21:27 PM yeah, it works upon lastest jquery.easyui.patch.js.
pageNumber will be reset to 1 when load remote. thanks. Code: $('#dtgResult').datagrid('options').pageNumber = 0; // reset pageNumber for bug-fixing loadData i suggest adding 'clear' method or something like this in next version. :) Title: Re: [FIXED] how can i clear the rows of datagrid Post by: zhcnlei on September 03, 2014, 01:25:35 AM this problem does exist
[page] parameter, second post is 0 after using the patch, [page] parameter is 1 however, rows.length == 0, it will still be post twice Title: Re: [FIXED] how can i clear the rows of datagrid Post by: stworthy on September 03, 2014, 02:06:53 AM Please try to download the patch from http://www.jeasyui.com/download/downloads/jquery-easyui-1.4-patch.zip.
|