$("#folder_file").dataTable({
"iDefaultSortIndex": 0,
"fnInitComplete": function() { $('#processing_right').hide();}
});
<script type="text/javascript">
//keep a note of our datatable
var oTable;
$(document).ready(function() {
var table_initialised = false;
$("#tabs").tabs();
//bind the loading of the table to the tab select event so that we don't waste time and database effort
$('#tabs').bind('tabsselect', function(event, ui) {
if (ui.index == 1) {
if (table_initialised == false) {
//build the table from scratch
table_initialised = true;
oTable = $('#alerts').dataTable({
"aaSorting": [[0, 'desc']],
"bAutoWidth": false,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "alerts.json.aspx"
});
} else {
//redraw the table
oTable.fnDraw();
}
};
});
})
</script>
<script type="text/javascript" charset="utf-8">
var oTable;
$(document).ready( function () {
var oTable;
/* Init DataTables */
oTable = $('#example').dataTable();
/* TableToolsInit.sSwfPath = "dataTables-1.6/media/swf/ZeroClipboard.swf"; */
/* Apply the jEditable handlers to the table */
$('#example tbody td').editable( 'catch_data', {
"callback": function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
},
"submitdata": function ( value, settings ) {
return { "row_id": this.parentNode.getAttribute('id') };
},
"height": "14px"
} );
/* Map KeyTable reference */
var keys = new KeyTable( {
"table": document.getElementById('example')
} );
/* Apply a return key event to each cell in the table */
keys.event.action( null, null, function (nCell) {
/* Block KeyTable from performing any events while jEditable is in edit mode */
keys.block = true;
/* Initialise the Editable instance for this table */
$(nCell).editable( function (sVal) {
/* Submit function (local only) - unblock KeyTable */
keys.block = false;
return sVal;
}, {
"onblur": 'submit',
"onreset": function(){
/* Unblock KeyTable, but only after this 'esc' key event has finished. Otherwise
* it will 'esc' KeyTable as well
*/
setTimeout( function () {keys.block = false;}, 0);
}
} );
/* Dispatch click event to go into edit mode - Saf 4 needs a timeout... */
setTimeout( function () { $(nCell).click(); }, 0 );
} );
/* You might need to set the sSwfPath! Something like:
*/
} );
</script>
<div id="user_wrapper">
<table cellpadding="0" cellspacing="0" border="0" class="display dataWrapper KeyTable" id="example" width="50%">
<thead>
<tr>
<th>Name</th>
<th>Login name</th>
<th>Email</th>
<th>Created at</th>
</tr>
</thead>
<tbody>
<tr id="#example" class="gradeC">
<td >Moises</td>
<td>clare82</td>
<td>chauncey@hane.uk</td>
<td>2010-01-28 11:43:55 UTC</td>
</tr>
<tr id="#example" class="gradeA">
<td >Emil</td>
<td>beau37</td>
<td>robyn.mante@dicki.ca</td>
<td>2010-01-28 11:43:55 UTC</td>
</tr>
<tr id="#example" class="gradeC">
<td >Marco</td>
<td>malvina93</td>
<td>teagan@padberg.name</td>
<td>2010-01-28 11:43:56 UTC</td>
</tr>
etc
It looks like you're new here. If you want to get involved, click one of these buttons!
Get useful and friendly help straight from the source.