Jeditable with fnClickAddRow [Solved]

Jeditable with fnClickAddRow [Solved]

sporkd2sporkd2 Posts: 5Questions: 0Answers: 0
edited April 2011 in General
All,

This may be a really easy question but I am using Jeditable and the fnClickAddRow (). I tried calling the fnDrawCallback() but whenever I add a row it is not editable nor does it save. Here is my simple code:

[code]

var giCount = $i;
$(document).ready(function(){

/* Init DataTables */
var oTable = $('#min-table').dataTable( {
"aoColumns": [{"bVisible": false},null,null,null,null,null,{"sWidth": "30%"}],
"iDisplayLength": 10
});


function fnDrawCallback() {
$('td', oTable.fnGetNodes()).editable( '../release-datatables/examples/examples_support/editable_ajax.php', {
"callback": function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
},
"submitdata": function ( value, settings ) {
return {
"row_id": this.parentNode.getAttribute('id'),
"id": this.parentNode.getAttribute('id'),
"column": oTable.fnGetPosition( this )[2]
};
},
"height": "20px"
} );
};
} );
function fnClickAddRow() {
$('#min-table').dataTable().fnAddData( [
giCount+"$i",
giCount+".2",
giCount+".3",
giCount+".4",
giCount+".5",
giCount+".6",
giCount+".7" ] );

giCount++;
}

[/code]

Replies

  • sporkd2sporkd2 Posts: 5Questions: 0Answers: 0
    I should add that my .php script is a simple UPDATE based on the 'id' field which works great except for the addrow.
This discussion has been closed.