only first row is editable with datatables jeditable. why?

only first row is editable with datatables jeditable. why?

satrn_grlsatrn_grl Posts: 4Questions: 0Answers: 0
edited September 2013 in DataTables 1.9
using editable dataTable, and I'm able to edit the data on the first row of my table (last two columns). why are the other rows not editable? I'm expecting all rows for the last two columns to be editable.

I have tried assigned class="editable" to the table row tag, but that doesn't change the result. in the code below, i have no class assigned to the table row tag.

here is the debug link: http://debug.datatables.net/ahigal

jquery (in $(document).ready scope) :
[code]
var oTable = $('#myTable').dataTable( {
bFilter: false,
sPaginationType: 'full_numbers',
<!-- bProcessing: true, -->
bServerSide: true,
bJQueryUI: true,
fnDrawCallback: function( oSettings ) {
alert( 'DataTables has redrawn the table' );
}
});

$('.editable', oTable.fnGetNodes()).editable( 'editable_ajax.php', {
callback: function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] ); <!-- this is value, row and column -->
},
submitdata: function ( value, settings ) {
return {
row_id: this.parentNode.getAttribute('id'),
column: oTable.fnGetPosition( this )[2]
};
},
height: '14px'
} );
[/code]

php:
[code]
echo '';
echo 'KeyStoreDateGroupPositionCategoryLane 3';
foreach($page_data as $key => $row){
echo sprintf('%s%s%s%s%s%s%s',
$key, //this is for the row id
$key, //display key
$row['StoreNumber'],
$row['LaneDate'],
$row['LaneGroup'],
$row['LanePosition'],
$row['Category'],
$row['Lane3']);
}
echo '';
[/code]

Replies

  • satrn_grlsatrn_grl Posts: 4Questions: 0Answers: 0
    nevermind. i've spent hours on this, and just after posting the question, i realized the answer. the code is including the tbody tag in the array enumeration, and it should not. moving those tbody tags outside the foreach took care of the problem.
This discussion has been closed.