From: Joey Schulze Date: Sun, 7 Mar 2010 11:55:26 +0000 (+0100) Subject: Allow updating the filters separately X-Git-Tag: 2010-06-02_customer~91 X-Git-Url: https://git.infodrom.org/?p=misc%2Fkostenrechnung;a=commitdiff_plain;h=b1213d882cf9905af8301c3c409c487bd317505c;hp=7a4b0c60f1c56afa1087d1ad18113a7ca566f327 Allow updating the filters separately --- diff --git a/lib/functions.js b/lib/functions.js index de69409..2de1400 100644 --- a/lib/functions.js +++ b/lib/functions.js @@ -224,6 +224,25 @@ function grid_update(grid, filter, value) grid.buffer.fetch(-1); } +function grid_update_filters(grid) +{ + var todo = false; + for (var c=0; c < grid.headerColCnt; c++) { + var fmt = grid.columns[c].format; + if (typeof fmt.filterUI != 'string') continue; + if (fmt.filterUI != 's') continue; + $(grid.filterId(c)).options.length = 1; + + var options = {}; + Object.extend(options, grid.buffer.ajaxOptions); + var colnum = typeof(fmt.filterCol)=='number' ? fmt.filterCol : c; + + options.parameters = 'id='+grid.tableId+'&distinct='+colnum; + options.onComplete = grid.filterValuesUpdate.bind(grid,c); + new Ajax.Request(grid.buffer.dataSource, options); + } +} + var calendars = new Array(); function calendar_callback(value) {