Catch id row to edit some column

Catch id row to edit some column

coltyrcoltyr Posts: 1Questions: 0Answers: 0
edited October 2009 in General
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

Replies

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin
    Hi coltyr,

    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
  • valdezrvaldezr Posts: 49Questions: 0Answers: 0
    In fact, in submit data you get the values you need to submit
    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]
This discussion has been closed.