我使用数据表编辑器来显示行
这是我正在使用的代码
var editor;
$(document).ready( function () {
editor = new $.fn.dataTable.Editor( {
"ajaxUrl": {
"create": "admin/save",
},
"domTable": "#example",
"fields": [ {
"label": "username:",
"name": "username"
}, {
"label": "password:",
"name": "password",
"type":"password"
}, {
"label": "fname:",
"name": "fname"
}, {
"label": "lname:",
"name": "lname"
}, {
"label": "email:",
"name": "email"
},{
"label": "address:",
"name": "address"
}
]
} );
$('#example').dataTable( {
"sDom": "Tfrtip",
"aoColumns": [
{ "mData": "username"},
{ "mData": "password" },
{ "mData": "fname" },
{ "mData": "lname" },
{ "mData": "email" },
{ "mData": "address" }
],
"oTableTools": {
"sRowSelect": "single",
"aButtons": [
{ "sExtends": "editor_create", "editor": editor },
{ "sExtends": "editor_edit", "editor": editor },
{ "sExtends": "editor_remove", "editor": editor }
]
}
} );
} );
如何将表单数据传递给控制器页面。我也给出了名称字段,但它没有添加到元素中。create : admin/save 这里 admin 是控制器名称,save 是动作名称。
请帮我。