Redraw with new parameters

Redraw with new parameters

hughbarnardhughbarnard Posts: 1Questions: 0Answers: 0
edited February 2013 in General
Hi

First of all big thank you for this, I'm using it in two open source projects: https://github.com/hbarnard/vectormart and an upcoming version of: http://sourceforge.net/projects/cclite/ but I'm a newcomer to DataTables.

I have a Perl backend based on Mojolicious which will produce json easily but I want to re-draw one of my tables with the same column row layout but different parameters to choose the rows. The Ajax table definition is:
[code]
vector_table = $('#vector_log').dataTable({
"bProcessing": true,
"bServerSide": true,
"bJQueryUI": true,
"bStateSave": true,
"sAjaxSource": "/actions/search/list",
"sAjaxDataProp": "aaData",
"aoColumns": [{
"mData": "_id"
}, {
"mData": "requesttype"
}, {
"mData": "userLogin"
}, ],
"bPaginate": true,
"bFilter": true,
"bDeferRender": true,
"bSort": false,
"sPaginationType": "full_numbers",
"bAutoWidth": false,
"bLengthChange": false,
// "bScrollCollapse": true,
"fnRowCallback": function(nRow, aData, iDisplayIndex) {
var chk;
if (aData.userLogin == $.cookie("userLogin")) {
chk = '';
} else {
chk = ' ';
}
$('td:eq(0)', nRow).html(chk);
},
"bInfo": true,
"sDom": 'T<"clear">lfrtip',
"iDisplayLength": 5
});
[/code]

This will mean that for example, my sAjaxSource would become something like [code]/actions/search/list/parameter[/code] and then there would be a [code]vector_table.fnDraw[/code]. However I'm not really sure about the best way of expressing this? Incidentally the construction in the callback is pretty ugly too, but one thing at a time perhaps! Thanks for any suggestions, Hugh
This discussion has been closed.