Editable datatable with checkboxes and submit/delete button
Editable datatable with checkboxes and submit/delete button
Hello, I'm trying to realize datatable with checkboxes column to submit or delete rows. And got some problems with:
1. After updating cells - table is refreshing by searching/sorting, but they didn't have to.
2. Checkboxes should be unchecked after sorting/filtering/searching/paging.
[code] var oTable;
$(document).ready( function () {
var id = -1;//simulation of id
oTable = $('#example').dataTable({
"sAjaxSource": "scripts/server_processing.php",
bJQueryUI: true,
"bSortClasses": false,
"bProcessing": true,
"aaSorting": [[1, 'asc']],
sAddURL: "scripts/AddData.php",
"aoColumns": [
{
"bSortable": false
},
null,
null,
null,
null,
null
],
"sPaginationType": "full_numbers"}).makeEditable({
sAddDeleteToolbarSelector: ".dataTables_length",
sUpdateURL: "scripts/UpdateData.php",
fnDrawCallback: function () { alert("fnDraw"); },
"aoColumns": [
null,
{
cssclass : "required",
fnOnCellUpdated: function(sStatus, sValue, settings){
alert("(Cell Callback): Cell is updated with value " + sStatus);
}
},
{
indicator: 'Saving platforms...',
tooltip: 'Double-click to edit',
type: 'textarea',
submit: 'Ok',
cancel: 'Cancel'
},
{
tooltip: 'Click to select engine version',
loadtext: 'loading...',
type: 'select',
onblur: 'submit',
cancel: 'cancel',
loadurl: 'scripts/selectLoad.php',
loadtype: 'POST',
sUpdateURL: "scripts/UpdateData.php"
},
{},
{}
]
});
$('#form').submit(function() {
var data = {};
var j = 0;
for(i=0; i 0 ) {
$.ajax({
type: "POST",
url: 'scripts/SubmitData.php',
data: {data: data},
dataType: 'json',
cache: false
});
}
return false;
});
$('#SelectAll').click(function() {
var checked_status = this.checked;
$('input[type=checkbox]').each(function(){
this.checked = checked_status;
});
});
});[/code]
Sorry for my bad eng ;)
1. After updating cells - table is refreshing by searching/sorting, but they didn't have to.
2. Checkboxes should be unchecked after sorting/filtering/searching/paging.
[code] var oTable;
$(document).ready( function () {
var id = -1;//simulation of id
oTable = $('#example').dataTable({
"sAjaxSource": "scripts/server_processing.php",
bJQueryUI: true,
"bSortClasses": false,
"bProcessing": true,
"aaSorting": [[1, 'asc']],
sAddURL: "scripts/AddData.php",
"aoColumns": [
{
"bSortable": false
},
null,
null,
null,
null,
null
],
"sPaginationType": "full_numbers"}).makeEditable({
sAddDeleteToolbarSelector: ".dataTables_length",
sUpdateURL: "scripts/UpdateData.php",
fnDrawCallback: function () { alert("fnDraw"); },
"aoColumns": [
null,
{
cssclass : "required",
fnOnCellUpdated: function(sStatus, sValue, settings){
alert("(Cell Callback): Cell is updated with value " + sStatus);
}
},
{
indicator: 'Saving platforms...',
tooltip: 'Double-click to edit',
type: 'textarea',
submit: 'Ok',
cancel: 'Cancel'
},
{
tooltip: 'Click to select engine version',
loadtext: 'loading...',
type: 'select',
onblur: 'submit',
cancel: 'cancel',
loadurl: 'scripts/selectLoad.php',
loadtype: 'POST',
sUpdateURL: "scripts/UpdateData.php"
},
{},
{}
]
});
$('#form').submit(function() {
var data = {};
var j = 0;
for(i=0; i 0 ) {
$.ajax({
type: "POST",
url: 'scripts/SubmitData.php',
data: {data: data},
dataType: 'json',
cache: false
});
}
return false;
});
$('#SelectAll').click(function() {
var checked_status = this.checked;
$('input[type=checkbox]').each(function(){
this.checked = checked_status;
});
});
});[/code]
Sorry for my bad eng ;)
This discussion has been closed.