我正在使用 JQuery-DataTables-Editable-1.3 和 DataTables-1.9.4。我可以添加 add_delete_toolbar。但是,单击添加按钮时,formAddNewRow 未与页面中心对齐。已经搜索并尝试了很多组合。
$('#example').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/prgrm_mstr.php",
"aoColumns": [
{ "mData": "0", sDefaultContent: "" },
{ "mData": "1", sDefaultContent: "" }
]
} ).makeEditable({
sUpdateURL: function(value, settings)
{
return(value); //Simulation of server-side response using a callback function
},
sAddURL: "scripts/AddData.php",
sDeleteURL: "scripts/DeleteData.php",
sAddDeleteToolbarSelector: ".dataTables_length",
oAddNewRowButtonOptions: { label: "Add...",
icons: {primary:'ui-icon-plus'}
},
oDeleteRowButtonOptions: { label: "Delete",
icons: {primary:'ui-icon-trash'}
},
oAddNewRowFormOptions: {
title: 'Add a new program',
show: "blind",
hide: "blind",
modal: true
}
});
表格如下——
<form id="formAddNewRow" action="#" title="Add new record">
<label for="prgrm_id">Program ID</label>
<input type="text" name="prgrm_id" id="prgrm_id" class="required" rel="0" />
<label for="prgrm_nm">Program Name</label>
<input type="text" name="prgrm_nm" id="prgrm_nm" class="required" rel="0" />
</form>