Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用复选框更新datatables数据?_Javascript_Php_Jquery_Datatables - Fatal编程技术网

Javascript 如何使用复选框更新datatables数据?

Javascript 如何使用复选框更新datatables数据?,javascript,php,jquery,datatables,Javascript,Php,Jquery,Datatables,我在OctoberCMS中使用Datatables,我想通过复选框更新特定字段的数据。我找到了一个example(),它使用表单,但我不知道如何使用表单更新数据表 我应该使用表格并提交检查过的数据吗? 如果我这样做了,我如何将更改后的值返回到数据表中 没有办法通过datatables api或函数更新值吗 php块和html 应用程序id 应用程序名称 版本 BV 过程 剧本 习俗 操作系统 开始 结束 javascript部分 $(文档).ready(函数(){ var tableId

我在OctoberCMS中使用Datatables,我想通过复选框更新特定字段的数据。我找到了一个example(),它使用表单,但我不知道如何使用表单更新数据表

我应该使用表格并提交检查过的数据吗? 如果我这样做了,我如何将更改后的值返回到数据表中

没有办法通过datatables api或函数更新值吗

php块和html



应用程序id
应用程序名称
版本
BV
过程
剧本
习俗
操作系统
开始
结束
javascript部分

$(文档).ready(函数(){
var tableId=“datalist”;
var table=$('#'+tableId).DataTable({
处理:对,
服务器端:是的,
阿贾克斯:{
url:'/ajax?tb={{tableName | raw()}}}&fd={{fields | raw()}}}',,
键入:“GET”,
错误:函数(e){
控制台日志(e);
}
},
columnDefs:[
{
“目标”:0,
“复选框”:{
“selectRow”:true
}
}
],
选择:{
“样式”:“多”
},
是的,
页长:50,
服务器端php文件

函数onStart() { $table=$_GET['tb']; $length=$_GET['length']; $start=$_GET['start']; $fields=explode(“|”,$_GET['fd']); $searchVar=$\u获取['search']['value']; 如果($searchVar!=''){ $result=DB::table($table) ->其中('app_name','like','%.$searchVar.'%')) ->orWhere('app_id','like','%.$searchVar'%')) ->orderBy('idx','desc') ->get(); }否则{ $result=DB::table($table) ->跳过($start) ->限制(长度) ->orderBy('idx','desc') ->get(); } $data=array(); foreach($结果为$行){ $sub_array=array(); 对于($i=0;$i{$fields[$i]}); }else if($fields[$i]=='app_process'){ $ARR进程=[ 1=>'ready',2=>'go',3=>'ing',4=>'denial', 5=>'retry',6=>'reexam',7=>'complete',8=>'stopped', 9=>“过期”,10=>“有效” ]; foreach($arrProcess$key=>$val){ if($row->{$fields[$i]}==$key){ $sub_array[]=$arrProcess[$key]; } } }else if($fields[$i]=='script\u popup'){ if($row->{$fields[$i]}=='Y'){ $sub_array[]=“已安装”; }否则{ $sub_数组[]='-'; } }else if($fields[$i]=='custom_etc'){ 如果($row->{$fields[$i]}!=''){ $sub_数组[].=$row->{$fields[$i]}.“自定义”; }否则{ $sub_数组[]='-'; } }否则{ $sub_数组[]=$row->{$fields[$i]}; } } $data[]=$sub_数组; } $output=array( “draw”=>intval($\u GET['draw']), “recordsTotal”=>DB::table($table)->count(), “recordsFiltered”=>DB::table($table)->count(), “数据”=>$data, ); echo json_编码($output); }