diff --git a/etemplate/inc/class.etemplate_widget_nextmatch.inc.php b/etemplate/inc/class.etemplate_widget_nextmatch.inc.php index 7058216e22..b311db017e 100644 --- a/etemplate/inc/class.etemplate_widget_nextmatch.inc.php +++ b/etemplate/inc/class.etemplate_widget_nextmatch.inc.php @@ -117,16 +117,17 @@ class etemplate_widget_nextmatch extends etemplate_widget * * @param string $exec_id identifys the etemplate request * @param array $fetchList array of array with values for keys "startIdx" and "count" + * @param array $filters Search and filter parameters, passed to data source * @param string full id of widget incl. all namespaces * @return array with values for keys 'total', 'rows', 'readonlys' */ static public function ajax_get_rows($exec_id, $fetchList, $filters = array(), $form_name='nm') { - error_log(__METHOD__."('".substr($exec_id,0,10)."...',".array2string($fetchList).",'$form_name')"); + error_log(__METHOD__."('".substr($exec_id,0,10)."...',".array2string($fetchList).','.array2string($filters).",'$form_name')"); self::$request = etemplate_request::read($exec_id); $value = self::get_array(self::$request->content, $form_name, true); - $value += $filters; + $value = array_merge($value, $filters); $result = array('rows' => array()); foreach ($fetchList as $entry) diff --git a/etemplate/js/et2_extension_nextmatch.js b/etemplate/js/et2_extension_nextmatch.js index 3d8e704c1f..9c9dcc67e5 100644 --- a/etemplate/js/et2_extension_nextmatch.js +++ b/etemplate/js/et2_extension_nextmatch.js @@ -491,7 +491,8 @@ var et2_nextmatch_header_bar = Class.extend(et2_INextmatchHeader, { .addClass("header_count") .appendTo(this.div); - this.count.append("? - ? ").append(egw.lang("of")).append(" "); + // Need to figure out how to update this as grid scrolls + //this.count.append("? - ? ").append(egw.lang("of")).append(" "); this.count_total = jQuery(document.createElement("span")) .appendTo(this.count) .text(settings.total + ""); @@ -597,7 +598,7 @@ var et2_nextmatch_header_bar = Class.extend(et2_INextmatchHeader, { }); } }, - + /** * Build the selectbox filters in the header bar * Sets value, options, labels, and change handlers @@ -728,6 +729,20 @@ et2_register_widget(et2_nextmatch_sortheader, ['nextmatch-sortheader']); var et2_nextmatch_filterheader = et2_selectbox.extend(et2_INextmatchHeader, { + /** + * Override to add change handler + */ + createInputWidget: function() { + this._super.apply(this, arguments); + + this.input.change(this, function(event) { + if(typeof event.data.nextmatch.activeFilters.col_filter == 'undefined') + event.data.nextmatch.activeFilters.col_filter = {}; + event.data.nextmatch.activeFilters["col_filter"][event.data.id] = event.data.input.val() + event.data.nextmatch.applyFilters(); + }); + }, + /** * Set nextmatch is the function which has to be implemented for the * et2_INextmatchHeader interface.