Datatables and Jeditable and getting the new values of each column.
Datatables and Jeditable and getting the new values of each column.
Hi there.
I'm using DataTables and also Jeditable. I create my initial table in html, and then populate it from server side information. This works well. On a few fields I have the ability to edit these columns. This also works well, but the problem is, when I double click/edit the record and change say the text 0 to 99, it changes it to 99 as it should, but then when im trying to get this data to send elsewhere its still showing the 0 value instead of 99.
Basically, the column i'm editing is always 0 by default, the user puts in a value(which is the unit price) and from here should update the sub total (but still only client side) so im using this code:
$(".editable").live("click", function() {
$(this).editable("products_inline.php", {
indicator : "",
event : "dblclick",
style : "inherit",
onblur : 'submit',
tooltip : '',
placeholder: 'Double Click To Add',
type: 'text',
style : 'display: inline',
width: 30,
height:20,
onsubmit: function() {
var oTable = $('#added_products_table').dataTable();
var row = $(this).closest("tr").get(0);
var aData = oTable.fnGetData(row);
alert(aData[9]);
}
}).trigger("edit");
});
so on double click, it shows the edit box, i change to 99, and then the onsubmit function is called. This alerts 0, even though I have changed this to 99. How can i get the changed data?
Thanks for the help
I'm using DataTables and also Jeditable. I create my initial table in html, and then populate it from server side information. This works well. On a few fields I have the ability to edit these columns. This also works well, but the problem is, when I double click/edit the record and change say the text 0 to 99, it changes it to 99 as it should, but then when im trying to get this data to send elsewhere its still showing the 0 value instead of 99.
Basically, the column i'm editing is always 0 by default, the user puts in a value(which is the unit price) and from here should update the sub total (but still only client side) so im using this code:
$(".editable").live("click", function() {
$(this).editable("products_inline.php", {
indicator : "",
event : "dblclick",
style : "inherit",
onblur : 'submit',
tooltip : '',
placeholder: 'Double Click To Add',
type: 'text',
style : 'display: inline',
width: 30,
height:20,
onsubmit: function() {
var oTable = $('#added_products_table').dataTable();
var row = $(this).closest("tr").get(0);
var aData = oTable.fnGetData(row);
alert(aData[9]);
}
}).trigger("edit");
});
so on double click, it shows the edit box, i change to 99, and then the onsubmit function is called. This alerts 0, even though I have changed this to 99. How can i get the changed data?
Thanks for the help
This discussion has been closed.