现在我们已完成相应功能,并在选择“地区”及“代维公司”并保证这两个选项同时有值后,自动刷新第一个DataGrid(DG1)结果集

但是在DG1刷新完毕后,后面两个紧跟的DG2及DG3还是保有">
Home Web Front-end JS Tutorial DataGrid result set clearing method in EasyUI component under Jquery_jquery

DataGrid result set clearing method in EasyUI component under Jquery_jquery

May 16, 2016 pm 05:05 PM

We have a module as shown below. After selecting "Region" and "Agency Company", refresh the first DataGrid frame

and click to complete the next frame based on the behavioral data conditions in the first result set. Search

DataGrid result set clearing method in EasyUI component under Jquery_jquery

Now we have completed the corresponding function, and after selecting "Region" and "Agency Company" and ensuring that these two options have values ​​at the same time, the first page will be automatically refreshed A DataGrid (DG1) result set

But after DG1 is refreshed, the two following DG2 and DG3 still retain the previous results

I tried to change the query conditions of DG2 and DG3 , manually passing an empty ID value to the query() method, but it was later treated as the first query return by the background Controller layer

So I found such a method that can give them an empty result set string

As follows

Copy the code The code is as follows:

//Modify the maintenance company selection Resubmit the query after the box
function query1(){
var params = $('#dg1').datagrid('options').queryParams;
params.region = $('#region') .combotree('getValue');
params.company_id = $('#company_id').combotree('getValue');
params.contract_type = "line";//*Currently written as line, Later, it will be optimized into a tab page
if(params.company_id == "" || params.region == ""){
return;
}
$("#dg1").datagrid ('load');
$('#dg2').datagrid('loadData', { total: 0, rows: [] });//Clear the DateGrid below
$('#dg3') .datagrid('loadData', { total: 0, rows: [] });//Clear the DateGrid below
}

In this way, the data in the result set in DG2 and DG3 can be cleared smoothly

Another method is to traverse and delete the data in the result set
Copy the code The code is as follows:

var item = $('#filegrid').datagrid('getRows');
if (item) {
for (var i = item.length - 1; i > = 0; i--) {
var index = $('#filegrid').datagrid('getRowIndex', item[i]);
$('#filegrid').datagrid('deleteRow' , index);
}
}

Different paths to the same destination
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Replace String Characters in JavaScript Replace String Characters in JavaScript Mar 11, 2025 am 12:07 AM

Replace String Characters in JavaScript

jQuery Check if Date is Valid jQuery Check if Date is Valid Mar 01, 2025 am 08:51 AM

jQuery Check if Date is Valid

jQuery get element padding/margin jQuery get element padding/margin Mar 01, 2025 am 08:53 AM

jQuery get element padding/margin

10 jQuery Accordions Tabs 10 jQuery Accordions Tabs Mar 01, 2025 am 01:34 AM

10 jQuery Accordions Tabs

10 Worth Checking Out jQuery Plugins 10 Worth Checking Out jQuery Plugins Mar 01, 2025 am 01:29 AM

10 Worth Checking Out jQuery Plugins

HTTP Debugging with Node and http-console HTTP Debugging with Node and http-console Mar 01, 2025 am 01:37 AM

HTTP Debugging with Node and http-console

jquery add scrollbar to div jquery add scrollbar to div Mar 01, 2025 am 01:30 AM

jquery add scrollbar to div

Custom Google Search API Setup Tutorial Custom Google Search API Setup Tutorial Mar 04, 2025 am 01:06 AM

Custom Google Search API Setup Tutorial

See all articles