mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-25 14:41:50 +01:00
Get nextmatch filters with legacy JS working
This commit is contained in:
parent
d9275d53d0
commit
5dcdc58f50
@ -1065,7 +1065,7 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader, {
|
|||||||
_build_select: function(name, type, value, lang) {
|
_build_select: function(name, type, value, lang) {
|
||||||
// Create widget
|
// Create widget
|
||||||
var select = et2_createWidget(type, {
|
var select = et2_createWidget(type, {
|
||||||
"id": this.nextmatch.id + "_"+name,
|
"id": name,
|
||||||
"label": this.nextmatch.options.settings[name+"_label"]
|
"label": this.nextmatch.options.settings[name+"_label"]
|
||||||
},this);
|
},this);
|
||||||
|
|
||||||
@ -1084,14 +1084,27 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader, {
|
|||||||
|
|
||||||
// Set onChange
|
// Set onChange
|
||||||
var input = select.input;
|
var input = select.input;
|
||||||
if (this.nextmatch.options.settings[name+"_onchange"] &&
|
|
||||||
!this.nextmatch.options.settings[name+"_onchange"].match('/^this\.form\.submit();?$/'))
|
|
||||||
{
|
|
||||||
// Get the onchange function string
|
|
||||||
var onchange = this.nextmatch.options.settings[name+"_onchange"];
|
|
||||||
|
|
||||||
// Connect it to the onchange event of the input element
|
if (this.nextmatch.options.settings[name+"_onchange"])
|
||||||
input.change(this.nextmatch, et2_compileLegacyJS(onchange, this.nextmatch, input));
|
{
|
||||||
|
// Make sure to get the new value for filtering
|
||||||
|
input.change(this.nextmatch, function(event) {
|
||||||
|
event.data.activeFilters[name] = select.getValue();
|
||||||
|
event.data.applyFilters();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Get the onchange function string
|
||||||
|
var onchange = this.nextmatch.options.settings[name+"_onchange"]
|
||||||
|
|
||||||
|
// Real submits cause all sorts of problems
|
||||||
|
if(onchange.match(/this\.form\.submit/))
|
||||||
|
{
|
||||||
|
this.egw().debug("warn","%s tries to submit form",name);
|
||||||
|
onchange = onchange.replace(/this\.form\.submit\([^)]*\);?/,'return true;');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Connect it to the onchange event of the input element - may submit
|
||||||
|
input.change(this.nextmatch, et2_compileLegacyJS(onchange, this.nextmatch, select.getInputNode()));
|
||||||
}
|
}
|
||||||
else // default request changed rows with new filters, previous this.form.submit()
|
else // default request changed rows with new filters, previous this.form.submit()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user