Tracking Selectable Rows and last-updated-cell on serverside processing (using datatables-editable)

Tracking Selectable Rows and last-updated-cell on serverside processing (using datatables-editable)

CMCDragonkaiCMCDragonkai Posts: 3Questions: 0Answers: 0
edited February 2012 in General
I'm trying to figure out to replicated the state saved selectable rows and last updated cell. However I don't know how to create it, and also it is not present in the example packages! For example on this page: http://jquery-datatables-editable.googlecode.com/svn/trunk/inline-edit-extra.html after you update one of the inline cells, the when it redraws the table, it stays on the edited cell.

I've got all the lastest versions of datatables and datatables-editable and jquery editable. Can anyone help?

Here's the code I have right now.

[code]

var asInitVals = new Array();
var oTable;

/* Formating function for row details */
function fnFormatDetails ( nTr ){
var aData = oTable.fnGetData( nTr );
var sOut = '';
sOut += 'Personal DetailsInternship Details';
sOut += 'Name: '+aData['name']+'Email: '+aData['email']+'Phone: '+aData['phone']+'University: '+aData['university']+'Course: '+aData['course']+'Year of Graduation: '+aData['year_of_graduation']+'Part of LC: '+aData['part_of_lc']+'';
sOut += 'ID: '+aData['id']+'Status: '+aData['status']+'Date of Entry: '+aData['date_of_entry']+'Preferred Internship: '+aData['internship']+' (MT:'+aData['mt']+' TT:'+aData['tt']+' DT:'+aData['dt']+' ET:'+aData['et']+')Preferred Departure: '+aData['preferred_departure']+'Preferred Duration (in months): '+aData['preferred_duration']+'Date of Departure: '+aData['date_of_departure']+'Date of Return: '+aData['date_of_return']+'Review Financial Contract: '+aData['review_fin_contract']+'Inducted into LC: '+aData['inducted']+'';
sOut += 'NotesNOGO means countries the EP is not willing to go to. | GO means the countries the EP is interested in. | FINCOM means the EP\'s financial commitments. | WHY means why the EP chose AIESEC. | GOALS means the EP\'s short term goals.'+aData['notes']+'';
sOut += '';
return sOut;
}

$(document).ready(function(){

oTable = $('#ogx_app_table').dataTable({
"bProcessing" : true,
"bServerSide" : true,
"sPaginationType": "full_numbers",
"bStateSave": true,
"aaSorting": [[5,'desc']],
"bAutoWidth": false,
"iDisplayLength": 10,
"aLengthMenu": [[10, 50, 100, -1], [10, 50, 100 ,"All"]],
"sAjaxSource": "<?php bloginfo('template_directory'); ?>/ogx_app_datatables.php",
"aoColumns": [
{ "mDataProp": 'details_trigger', "bSortable": false, "sClass": "detail_td", "bSearchable": false, },
{ "mDataProp": 'id' },
{ "mDataProp": 'status' },
{ "mDataProp": 'name' },
{ "mDataProp": 'internship' },
{ "mDataProp": 'date_of_entry' },
{ "mDataProp": 'date_of_departure' },
{ "mDataProp": 'date_of_return' },
],
"oLanguage": {
"sSearch": "Search all columns:"
}
}).makeEditable({
sUpdateURL: "<?php bloginfo('template_directory'); ?>/ogx_app_datatables.php",
"aoColumns": [
null,
null,
{
tooltip: 'Click to update status!',
loadtext: 'loading...',
type: 'select',
onblur: 'cancel',
submit: 'Submit',
data: "{'open':'Open','taken':'Taken','interview':'Interview','mrb':'MRB','pdd':'PDD','predeparture':'PreDeparture','interning':'Interning','returned':'Returned','terminate':'Terminate','inducted':'Inducted','rejected':'Rejected','priority':'PRIORITY','delete':'Delete'}",
},
null,
null,
null,
null,
null,
],
fnShowError: false,
}).columnFilter({
aoColumns: [
null,
{ type: "number" },
{ type: "select", values: [ 'Open', 'Taken', 'Interview', 'MRB', 'PDD', 'PreDeparture', 'Interning', 'Returned', 'Terminate', 'Inducted', 'Rejected', 'PRIORITY', 'Delete'] },
{ type: "text" },
{ type: "text" },
{ type: "text" },
{ type: "text" },
{ type: "text" },
{ type: "text" },
],
});



$('#ogx_app_table tbody td img').live( 'click', function () {
var nTr = $(this).parents('tr')[0];
if ( oTable.fnIsOpen(nTr) )
{
/* This row is already open - close it */
this.src = "<?php bloginfo('template_directory'); ?>/images/details_open.png";
oTable.fnClose( nTr );
}
else
{
/* Open this row */
this.src = "<?php bloginfo('template_directory'); ?>/images/details_close.png";
oTable.fnOpen( nTr, fnFormatDetails(nTr), 'details' );
}
} );

});


[/code]
This discussion has been closed.