record id with server-side
record id with server-side
looking for some guidance...
I have a mysql customer's table.. with a record_id index. All I want to do is when I click/dblclick on a row bring up the record_id of that row from mysql table. I would prefer to have the record_id hidden as say the id element of the tr but I couldn't get that to work. So I tried just displaying it as a column named customer ID and I can't get that to work either... I know I am missing something simple here but I just cant figure it out. Ultimately I would like when I doubleclick on the row the next page would come up with the customer info (based on the record_id)... for right now I am just trying to get an alert with the record_id displaying...
If I am going about this the wrong way please let me know...
I have a mysql customer's table.. with a record_id index. All I want to do is when I click/dblclick on a row bring up the record_id of that row from mysql table. I would prefer to have the record_id hidden as say the id element of the tr but I couldn't get that to work. So I tried just displaying it as a column named customer ID and I can't get that to work either... I know I am missing something simple here but I just cant figure it out. Ultimately I would like when I doubleclick on the row the next page would come up with the customer info (based on the record_id)... for right now I am just trying to get an alert with the record_id displaying...
If I am going about this the wrong way please let me know...
This discussion has been closed.
Replies
Anyway thanks for your input I am going to check out those examples and see if I can figure this out...
I returned my record id as a hidden column then used fnRowCallback in the following code to add the record id as the row id.
[code]
"fnRowCallback": function (nRow, aData) {
$(nRow).attr("id",aData[0]);
return nRow;
},
[/code]
then used a live click event as follows to display the record id...
[code]
$('#customer_table tbody tr').live('click', function () {
var cust_id = $(this).attr('id');
alert(cust_id);
});
[/code]
I am not sure if this is the most efficient way to do what I want but it gets the job done.
thanks for all your help...