|
|
@@ -672,7 +672,9 @@ class TableAjax extends ViewAjax {
|
|
|
funHtml.attr('href', funObj.href || '#');
|
|
|
if (funObj.title) funHtml.attr('title', funObj.title);
|
|
|
if (funObj.icon) funHtml.attr('class', 'ico-' + funObj.icon);
|
|
|
- if (funObj.method) funHtml.on('click', priv[funObj.method]);
|
|
|
+ if (funObj.method && priv[funObj.method] && typeof priv[funObj.method] == 'function') {
|
|
|
+ funHtml.on('click', priv[funObj.method]);
|
|
|
+ }
|
|
|
funHtml.appendTo(headCell);
|
|
|
});
|
|
|
}
|
|
|
@@ -1717,6 +1719,7 @@ class TableAjax extends ViewAjax {
|
|
|
*/
|
|
|
priv.filterChanged = function (e) {
|
|
|
//clear old timer if we're typing fast enough
|
|
|
+ if (priv.options.debug) console.log('filterChanged L.<?php echo __LINE__; ?>');
|
|
|
if (_filterTimeout) {
|
|
|
clearTimeout(_filterTimeout);
|
|
|
if (priv.options.debug) console.log('filtering cancelled');
|
|
|
@@ -2350,7 +2353,12 @@ class TableAjax extends ViewAjax {
|
|
|
hash = '#' + hash;
|
|
|
}
|
|
|
location.hash = hash;
|
|
|
- },
|
|
|
+ };
|
|
|
+
|
|
|
+ priv.refresh = function (e) {
|
|
|
+ e.preventDefault();
|
|
|
+ publ.loadPage(_currPage);
|
|
|
+ };
|
|
|
|
|
|
publ.init = function (options) {
|
|
|
if (priv.options.debug) console.log('TableAjax initialization...');
|
|
|
@@ -2471,7 +2479,7 @@ jQuery(document).ready(function(){
|
|
|
filter: true,
|
|
|
filterInit: <?php echo json_encode($filterInit); ?>,
|
|
|
forceFilterInit: <?php echo json_encode($forceFilterInit); ?>,
|
|
|
- debug: false, // TODO: DBG
|
|
|
+ debug: true, // TODO: DBG
|
|
|
height: 400, // TODO: ?
|
|
|
sorting: true, // TODO: ?
|
|
|
paging: true, // TODO: ?
|
|
|
@@ -2501,6 +2509,11 @@ jQuery(document).ready(function(){
|
|
|
href: '#CREATE',
|
|
|
icon: 'plus',
|
|
|
title: 'Dodaj nowy rekord'
|
|
|
+ },
|
|
|
+ refresh: {
|
|
|
+ icon: 'refresh',
|
|
|
+ title: 'Odśwież dane',
|
|
|
+ method: 'refresh'
|
|
|
}
|
|
|
},
|
|
|
rowFunctions: <?php echo json_encode($rowFunctions); ?>,
|