We have a module below, which requires selecting "Region" and "Dai-wei Company" to refresh the first DataGrid frame body
and click to complete the search of the next frame with the behavior data condition of the first result set.
Now that we have completed the function, we will automatically refresh the first DataGrid (DG1) result set when we select "Region" and "Company" and guarantee that both options have a value
But after the DG1 has been refreshed, the following two DG2 and DG3 are still the results
I tried to change the query criteria for DG2 and DG3 by manually passing an empty ID value to the query () method, but then returned to the controller layer in the background as the first query.
So we found a way to give them an empty result set string
As follows
Copy Code code as follows:
Re-submit a query after modifying the surrogate-dimension company Marquee
function Query1 () {
var params = $ (' #dg1 '). DataGrid (' Options '). Queryparams;
Params.region = $ (' #region '). Combotree (' GetValue ');
params.company_id = $ (' #company_id '). Combotree (' GetValue ');
Params.contract_type = "line";//* is currently written dead for lines, and later optimized for label pages
if (params.company_id = = "" | | Params.region = = "") {
Return
}
$ ("#dg1"). DataGrid (' Load ');
$ (' #dg2 '). DataGrid (' LoadData ', {total:0, rows: []});/clear Dategrid below
$ (' #dg3 '). DataGrid (' LoadData ', {total:0, rows: []});/clear Dategrid below
}
This will smooth out the data for the result set in DG2 and DG3.
There is also a way to traverse and delete data in the result set
Copy Code code 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);
}
}
Converging