- });
- columns = columns.substring(0, columns.length - 1 );
- sortColumn = sortColumn.substring(0, sortColumn.length - 1 );
- eval('sortColumn =[' + sortColumn + ']');
- eval('columns =[' + columns + ']');
-
- var currTable = cj(tabId);
- if (currTable) {
- // contains the dataTables master records
- var s = cj(document).dataTableSettings;
- if (s != 'undefined') {
- var len = s.length;
- for (var i=0; i < len; i++) {
- // if already exists, remove from the array
- if (s[i].sInstance = tabId) {
- s.splice(i,1);
- }
- }
- }
- }
-
- var noRecordFoundMsg = {/literal}'{ts escape="js"}There are no records.{/ts}'{literal};
-
- oTable = null;
- if ( useAjax ) {
- oTable = cj(tabId).dataTable({
- "bFilter" : false,
- "bAutoWidth" : false,
- "aaSorting" : sortColumn,
- "aoColumns" : columns,
- "bProcessing": true,
- "bJQueryUI" : true,
- "asStripClasses" : [ "odd-row", "even-row" ],
- "sPaginationType": "full_numbers",
- "sDom" : '<"crm-datatable-pager-top"lfp>rt<"crm-datatable-pager-bottom"ip>',
- "bServerSide": true,
- "sAjaxSource": sourceUrl,
- "oLanguage":{"sEmptyTable" : noRecordFoundMsg,
- "sZeroRecords" : noRecordFoundMsg },
-
- {/literal}{if !empty($callBack)}{literal}
- "fnDrawCallback": function() { checkSelected(); },
- {/literal}{/if}{literal}
+ });
+ // Fixme: this could be done without eval
+ columns = columns.substring(0, columns.length - 1 );
+ sortColumn = sortColumn.substring(0, sortColumn.length - 1 );
+ eval('sortColumn =[' + sortColumn + ']');
+ eval('columns =[' + columns + ']');