var sourceUrl = '';
var useClass = 'display';
- var tcount = 1;
+ var tcount = 1, tableId = [];
if ( useAjax ) {
{/literal}{if isset($sourceUrl)}sourceUrl = "{$sourceUrl}";{/if}{literal}
useClass = 'pagerDisplay';
tcount = 5;
}
- var tableId = [], count = 1;
+ CRM.dataTableCount = CRM.dataTableCount || 1;
//rename id of table with sequence
//and create the object for navigation
- $('table.' + useClass).each(function() {
- $(this).attr('id','option' + tcount + count);
- tableId.push(count);
- count++;
+ $('table.' + useClass).not('.dataTable').each(function() {
+ $(this).attr('id','option' + tcount + CRM.dataTableCount);
+ tableId.push(CRM.dataTableCount);
+ CRM.dataTableCount++;
});
$.each(tableId, function(i,n){
eval('sortColumn =[' + sortColumn + ']');
eval('columns =[' + columns + ']');
- var currTable = $(tabId);
- if (currTable) {
- // contains the dataTables master records
- var s = $(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"}None found.{/ts}'{literal};
var oTable;