Editable
Editable
I am using datatable with server side scripting (asp.net) and the data is showing correctly.
Now i am trying to make it editable, code as below:
[code]
$(document).ready(function () {
/* Init DataTables */
var oTable = $('#example').dataTable(
{
"bProcessing": true,
"bServerSide": true,
"bPaginate": true,
"bAutoWidth": true,
"bFilter": false,
"bSort": false,
"bInfo": true,
"sPaginationType": "full_numbers",
"sAjaxSource": "serverProcessing.aspx"
}
)
alert(oTable.fnGetData(0));
/* Apply the jEditable handlers to the table */
$('td', oTable.fnGetNodes()).editable('ExampleEditable.aspx', {
"fnDrawCallback": function (sValue, y) {
alert('##DataTables has redrawn the table');
var aPos = oTable.fnGetPosition(this);
oTable.fnUpdate(sValue, aPos[0], aPos[1]);
},
"submitdata": function (value, settings) {
return {
"row_id": this.parentNode.getAttribute('id'),
"column": oTable.fnGetPosition(this)[2]
};
},
"height": "14px"
});
})
[/code]
The above work if I have this line in between the function:
[code]
alert(oTable.fnGetData(0));
[/code]
For some reason if i commented out the alert line above, the editable box will not show up. Please help.
Thanks,
-Joanne
Now i am trying to make it editable, code as below:
[code]
$(document).ready(function () {
/* Init DataTables */
var oTable = $('#example').dataTable(
{
"bProcessing": true,
"bServerSide": true,
"bPaginate": true,
"bAutoWidth": true,
"bFilter": false,
"bSort": false,
"bInfo": true,
"sPaginationType": "full_numbers",
"sAjaxSource": "serverProcessing.aspx"
}
)
alert(oTable.fnGetData(0));
/* Apply the jEditable handlers to the table */
$('td', oTable.fnGetNodes()).editable('ExampleEditable.aspx', {
"fnDrawCallback": function (sValue, y) {
alert('##DataTables has redrawn the table');
var aPos = oTable.fnGetPosition(this);
oTable.fnUpdate(sValue, aPos[0], aPos[1]);
},
"submitdata": function (value, settings) {
return {
"row_id": this.parentNode.getAttribute('id'),
"column": oTable.fnGetPosition(this)[2]
};
},
"height": "14px"
});
})
[/code]
The above work if I have this line in between the function:
[code]
alert(oTable.fnGetData(0));
[/code]
For some reason if i commented out the alert line above, the editable box will not show up. Please help.
Thanks,
-Joanne
This discussion has been closed.