Nickel Titanium Alloy News and > Nickel Titanium Alloy supplier > Gets the row data selected in the check box

Gets the row data selected in the check box

Nickel Titanium Alloy supplier 2021-08-09 09:19 80

in daily report making, we will encounter some functions that require batch operations, such as batch deletion, batch warehousing, batch addition, batch modification, batch query, etc. at this time, the time length is also linked to the check box; Generally, in the report, we can check the check box, and then trigger JavaScript events through buttons or hyperlinks to obtain the data in the selected row of the check box, and click one button to delete, store, modify and query the selected data

next, let's explain how to obtain the data of the selected row by obtaining the check box, and then transfer parameters. You can delete, store, modify and query the selected data with one click

1, report design

This report is used for file upload and data sorting and warehousing. Here is an example of the multi file deletion function

2, JavaScript event

The

code is as follows:

//Get checkbox
var $span = $(.mr-checkbox-checkon);
var darray = [];
var array = [];
var $tds = $(td).has($span);
var len = $tds.length;
if(len<= 0){
Alert (please select a record!);
return;
}
//Gets the data for the row selected in the check box
for (var i = 0;  i <  len;  i ++) {
var id = $($tds[i]).attr(id);
if (id) {
var rownum =contentPane.curLGP.getTDRow($tds[i])-1;
var wjid=contentPane.getCellValue(2,rownum);
array.push(wjid);
darray.push(id);
}
}
console.log(array);
//Delete row in check box
contentPane.deleteReportRC(null,darray);
//Carry out parameter transfer processing, and then carry out processing according to their own conditions, such as deleting data

can also directly splice strings according to their own needs

3. Renderings

through the above operations, you can get the row data selected in the check box through JavaScript, then delete the data with one click, and delete the display data on the report page to achieve the desired effect

Tag:Gets,the,row,data,selected,che