mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 07:09:20 +01:00
Get filterheaders working
This commit is contained in:
parent
4e8fe1bb2c
commit
36c39cf4b8
@ -117,16 +117,17 @@ class etemplate_widget_nextmatch extends etemplate_widget
|
|||||||
*
|
*
|
||||||
* @param string $exec_id identifys the etemplate request
|
* @param string $exec_id identifys the etemplate request
|
||||||
* @param array $fetchList array of array with values for keys "startIdx" and "count"
|
* @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
|
* @param string full id of widget incl. all namespaces
|
||||||
* @return array with values for keys 'total', 'rows', 'readonlys'
|
* @return array with values for keys 'total', 'rows', 'readonlys'
|
||||||
*/
|
*/
|
||||||
static public function ajax_get_rows($exec_id, $fetchList, $filters = array(), $form_name='nm')
|
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);
|
self::$request = etemplate_request::read($exec_id);
|
||||||
$value = self::get_array(self::$request->content, $form_name, true);
|
$value = self::get_array(self::$request->content, $form_name, true);
|
||||||
$value += $filters;
|
$value = array_merge($value, $filters);
|
||||||
$result = array('rows' => array());
|
$result = array('rows' => array());
|
||||||
|
|
||||||
foreach ($fetchList as $entry)
|
foreach ($fetchList as $entry)
|
||||||
|
@ -491,7 +491,8 @@ var et2_nextmatch_header_bar = Class.extend(et2_INextmatchHeader, {
|
|||||||
.addClass("header_count")
|
.addClass("header_count")
|
||||||
.appendTo(this.div);
|
.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"))
|
this.count_total = jQuery(document.createElement("span"))
|
||||||
.appendTo(this.count)
|
.appendTo(this.count)
|
||||||
.text(settings.total + "");
|
.text(settings.total + "");
|
||||||
@ -728,6 +729,20 @@ et2_register_widget(et2_nextmatch_sortheader, ['nextmatch-sortheader']);
|
|||||||
|
|
||||||
var et2_nextmatch_filterheader = et2_selectbox.extend(et2_INextmatchHeader, {
|
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
|
* Set nextmatch is the function which has to be implemented for the
|
||||||
* et2_INextmatchHeader interface.
|
* et2_INextmatchHeader interface.
|
||||||
|
Loading…
Reference in New Issue
Block a user