Easyui check box Bulk operations

Source: Internet
Author: User

Front desk JS Code

function destroyexcelout () {

Returns multiple rows selected

var row = $ (' #dg '). DataGrid (' Getselections ');

Deciding whether to select BOC

if (row.length==0) {

$.messager.alert ("Hint", "Please select the row to delete!") "," info ");

return;

}Else{

var temid= "";

Bulk get evaluation template ID for selected row

$.messager.confirm (' Hint ', ' Do you want to delete the selected data? ', function (r) {

if (!R) {

return;

}

Link the ID string together

for (i = 0; i < row.length;i++) {

if (Temid = = "") {

Temid = row[i].id;

} Else {

Temid = Row[i].id + "," + temid;

}

}

$.post (' __root__/index.php/comprehensive/deletecomprehensive/', ' id= ' +temid,function(result) {

off (!result==false) {

$.messager.show ({//Show error message

Title: ' Success ',

Msg: ' Delete entry succeeded! ‘

});

$ (' #dg '). DataGrid (' reload '); Reload the user data

$ (' #dg '). DataGrid (' Clearselections ');

} Else {

$.messager.show ({//Show error message

Title: ' Failure ',

Msg: ' Operation failed!! ‘

});

}

}, ' json ');

});

}

$ (' #fm '). Form (' Load ', row);

}

Background code

Public function deletecomprehensive () {

$SJCJ =m (' SJCJ ');

$strTemId =i (' post.id ');

$strid =explode (', ', $strTemId);

$value = "";

foreach ($strid as $val) {

$value. = ", '". $val. "";

}

$result = $SJCJ->where ("ID in (". substr ($value, 1). ") ->delete ();

$result = $SJCJ->where (' id= '. I (' post.id '))->delete ();

if ($result = =true) {

Write log

$log =m (' log ');

$logData [' Operate ']= ' delete ';

$logData [' object ']= ' T_SJCJ ';

$logData [' Items ']=i (' post.tybh ');

$logData [' Time ']=date (' y-m-d h:i:s ');

$logData [' User ']=session (' user ');

$log->add ($logData);

}

echo $result;

}

}

Easyui check box Bulk operations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.