Having trouble with Jeditable warning. Appreciate your help.
Having trouble with Jeditable warning. Appreciate your help.
kunjsraval
Posts: 2Questions: 0Answers: 0
Hi All,
I am using dataTable with Jeditable functionality. When I edit table cell, I am trying to retrieve the old value and new value as well.
But, I am getting a warning:-
DataTables warning (table id = 'adminTable'): Requested unknown parameter '6' from the data source for row 83
Can anyone please help me with this warning? Or, is there any other way I could retrieve an old value?
Here is my script:
$(document).ready(function() {
var sOldValue;
var oTable = $('#adminTable').dataTable( {
"sPaginationType" : "full_numbers",
"aLengthMenu" : [ [ 10, 25, 50, -1 ], [ 10, 25, 50, "All" ] ]
}).makeEditable({
oEditableSettings : {event : 'click'},
"aoColumns" : [ null,
{},
{},
{},
{},
{},
{
onsubmit : function(settings, original){
sOldValue = original.revert;
}
},
{}
],
sUpdateURL : function (value, settings) {
//var sOldValue = original.revert;
var id = oTable.fnGetPosition(this)[0] ;
//var columnPosition = oTable.fnGetPosition(this)[1];
var columnId = oTable.fnGetPosition(this)[2];
var sColumnName = oTable.fnSettings().aoColumns[columnId].sTitle;
var tbl_id = $("#adminTable").find("td:eq(0)").text();
var tbl_company = $("#adminTable").find("td:eq(1)").text();
var tbl_name = $("#adminTable").find("td:eq(2)").text();
alert("ID ~~~ " + id);
alert("Column Name ~~~ " + sColumnName);
alert("Reference ID ~~~ " + tbl_id);
alert("Reference Company ~~~ " + tbl_company);
alert("New Value ~~~ " + value);
alert("Old Value ~~~ " + sOldValue);
//alert("Column Position ~~~ " + columnPosition);
if (confirm('Do you wan\'t to update this item?')){
/*$.ajax({
type : 'POST',
url : "Controller",
data : {
"action" : "updateAdminData",
"id" : id,
"column_Name" : sColumnName,
"tbl_id" : tbl_id,
"tbl_company" : tbl_company,
"tbl_name" : tbl_name,
"updated_value" : value,
"value_before_update" : sOldValue
},
submit : 'OK',
dataType : "json",
success : function(){
$("#id").append(value);
alert("You have successfully updated the value!");
}
});*/
alert("You have successfully updated the value!");
return (value);
}
return ("Update function did not perform!");
}
});
});
I am using dataTable with Jeditable functionality. When I edit table cell, I am trying to retrieve the old value and new value as well.
But, I am getting a warning:-
DataTables warning (table id = 'adminTable'): Requested unknown parameter '6' from the data source for row 83
Can anyone please help me with this warning? Or, is there any other way I could retrieve an old value?
Here is my script:
$(document).ready(function() {
var sOldValue;
var oTable = $('#adminTable').dataTable( {
"sPaginationType" : "full_numbers",
"aLengthMenu" : [ [ 10, 25, 50, -1 ], [ 10, 25, 50, "All" ] ]
}).makeEditable({
oEditableSettings : {event : 'click'},
"aoColumns" : [ null,
{},
{},
{},
{},
{},
{
onsubmit : function(settings, original){
sOldValue = original.revert;
}
},
{}
],
sUpdateURL : function (value, settings) {
//var sOldValue = original.revert;
var id = oTable.fnGetPosition(this)[0] ;
//var columnPosition = oTable.fnGetPosition(this)[1];
var columnId = oTable.fnGetPosition(this)[2];
var sColumnName = oTable.fnSettings().aoColumns[columnId].sTitle;
var tbl_id = $("#adminTable").find("td:eq(0)").text();
var tbl_company = $("#adminTable").find("td:eq(1)").text();
var tbl_name = $("#adminTable").find("td:eq(2)").text();
alert("ID ~~~ " + id);
alert("Column Name ~~~ " + sColumnName);
alert("Reference ID ~~~ " + tbl_id);
alert("Reference Company ~~~ " + tbl_company);
alert("New Value ~~~ " + value);
alert("Old Value ~~~ " + sOldValue);
//alert("Column Position ~~~ " + columnPosition);
if (confirm('Do you wan\'t to update this item?')){
/*$.ajax({
type : 'POST',
url : "Controller",
data : {
"action" : "updateAdminData",
"id" : id,
"column_Name" : sColumnName,
"tbl_id" : tbl_id,
"tbl_company" : tbl_company,
"tbl_name" : tbl_name,
"updated_value" : value,
"value_before_update" : sOldValue
},
submit : 'OK',
dataType : "json",
success : function(){
$("#id").append(value);
alert("You have successfully updated the value!");
}
});*/
alert("You have successfully updated the value!");
return (value);
}
return ("Update function did not perform!");
}
});
});
This discussion has been closed.