Catch id row to edit some column
Catch id row to edit some column
Hello,
I have the datatable with jEditable and i need to catch a row id or column id. Example next:
html example:
[code]
teste
teste2
teste3
teste4
[/code]
i have this code for edit:
[code]$('#example tbody tr td:nth-child(2)').editable('../funcionalidades/core_content/content.table.php',{
submit: 'OK',
callback: function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
},
height': '14px'
} );[/code]
the value of the text edited i catch with -> [code]$str = $_POST['value'];[/code]
and i need to catch de row id or the column id to record on the right place on my mysql database.
Thanks, and sorry for my english :d
I have the datatable with jEditable and i need to catch a row id or column id. Example next:
html example:
[code]
teste
teste2
teste3
teste4
[/code]
i have this code for edit:
[code]$('#example tbody tr td:nth-child(2)').editable('../funcionalidades/core_content/content.table.php',{
submit: 'OK',
callback: function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
},
height': '14px'
} );[/code]
the value of the text edited i catch with -> [code]$str = $_POST['value'];[/code]
and i need to catch de row id or the column id to record on the right place on my mysql database.
Thanks, and sorry for my english :d
This discussion has been closed.
Replies
You need to add a pre-submit handler to jEditable (submitdata I think) which will need to get the ID either directly from the DOM or using fnGetData(). Have a look at the jEditable docuemtnation for how to add variables to the post back.
Regards,
Allan
and the values on rows, columns can be obtained this way
[code]
$("#example tbody td").click(function(event) {
/* Get the position of the current data from the node */
aPos = oTable.fnGetPosition( this );
/* Get the data array for this row */
aData = oTable.fnGetData( aPos[0] );
});
[/code]