forked from extern/egroupware
Fix widget not allowed / DOM error in nextmatch-accountfilter
This commit is contained in:
parent
194dd78deb
commit
aa07a243c1
@ -1386,7 +1386,7 @@ var et2_nextmatch_customfields = et2_customfields_list.extend(et2_INextmatchHead
|
|||||||
{
|
{
|
||||||
widget = et2_createWidget("nextmatch-entryheader", {
|
widget = et2_createWidget("nextmatch-entryheader", {
|
||||||
id: cf_id,
|
id: cf_id,
|
||||||
application: field.type,
|
only_app: field.type,
|
||||||
blur: field.label
|
blur: field.label
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
@ -1660,7 +1660,7 @@ var et2_nextmatch_entryheader = et2_link_entry.extend(et2_INextmatchHeader, {
|
|||||||
if(typeof this.nextmatch.activeFilters.col_filter == 'undefined')
|
if(typeof this.nextmatch.activeFilters.col_filter == 'undefined')
|
||||||
this.nextmatch.activeFilters.col_filter = {};
|
this.nextmatch.activeFilters.col_filter = {};
|
||||||
if(selected && selected.item.value) {
|
if(selected && selected.item.value) {
|
||||||
if(event.data.options.application)
|
if(event.data.options.only_app)
|
||||||
{
|
{
|
||||||
// Only one application, just give the ID
|
// Only one application, just give the ID
|
||||||
this.nextmatch.activeFilters["col_filter"][this.id] = selected.item.value;
|
this.nextmatch.activeFilters["col_filter"][this.id] = selected.item.value;
|
||||||
|
@ -389,7 +389,6 @@ var et2_link_entry = et2_inputWidget.extend({
|
|||||||
init: function() {
|
init: function() {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
|
|
||||||
this.div = null;
|
|
||||||
this.search = null;
|
this.search = null;
|
||||||
this.app_select = null;
|
this.app_select = null;
|
||||||
this._oldValue = {id: null, app: this.options.only_app};
|
this._oldValue = {id: null, app: this.options.only_app};
|
||||||
@ -536,7 +535,7 @@ var et2_link_entry = et2_inputWidget.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
getDOMNode: function() {
|
getDOMNode: function() {
|
||||||
return this.div[0];
|
return this.div ? this.div[0] : null;
|
||||||
},
|
},
|
||||||
|
|
||||||
transformAttributes: function(_attrs) {
|
transformAttributes: function(_attrs) {
|
||||||
|
@ -63,9 +63,6 @@ var et2_selectAccount = et2_selectbox.extend({
|
|||||||
|
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
|
|
||||||
// Allow search 'inside' this widget
|
|
||||||
this.supportedWidgetClasses = [et2_link_entry];
|
|
||||||
|
|
||||||
// Holder for search jQuery nodes
|
// Holder for search jQuery nodes
|
||||||
this.search = null;
|
this.search = null;
|
||||||
|
|
||||||
@ -98,6 +95,9 @@ var et2_selectAccount = et2_selectbox.extend({
|
|||||||
}
|
}
|
||||||
else if (type == 'popup')
|
else if (type == 'popup')
|
||||||
{
|
{
|
||||||
|
// Allow search 'inside' this widget
|
||||||
|
this.supportedWidgetClasses = [et2_link_entry];
|
||||||
|
|
||||||
this._create_search();
|
this._create_search();
|
||||||
// Use empty label as blur
|
// Use empty label as blur
|
||||||
if(this.options.empty_label) this.search_widget.set_blur(this.options.empty_label);
|
if(this.options.empty_label) this.search_widget.set_blur(this.options.empty_label);
|
||||||
@ -112,11 +112,12 @@ var et2_selectAccount = et2_selectbox.extend({
|
|||||||
}
|
}
|
||||||
this.search_widget.search.change(this, function(event) {
|
this.search_widget.search.change(this, function(event) {
|
||||||
var value = event.data.search_widget.getValue();
|
var value = event.data.search_widget.getValue();
|
||||||
event.data.value = typeof value == 'object' ? value.id : value;
|
event.data.value = typeof value == 'object' && value ? value.id : value;
|
||||||
event.data.input.trigger("change");
|
event.data.input.trigger("change");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.setDOMNode(this.search_widget.getDOMNode());
|
var div = jQuery(document.createElement("div")).append(this.search_widget.getDOMNode());
|
||||||
|
this.setDOMNode(div[0]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -145,12 +146,16 @@ var et2_selectAccount = et2_selectbox.extend({
|
|||||||
}
|
}
|
||||||
else if (type == 'popup')
|
else if (type == 'popup')
|
||||||
{
|
{
|
||||||
|
// Allow search 'inside' this widget
|
||||||
|
this.supportedWidgetClasses = [et2_link_entry];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Popup takes the dialog and embeds it in place of the selectbox
|
* Popup takes the dialog and embeds it in place of the selectbox
|
||||||
*/
|
*/
|
||||||
var dialog = this._open_multi_search();
|
var dialog = this._open_multi_search();
|
||||||
dialog.dialog("close");
|
dialog.dialog("close");
|
||||||
this.setDOMNode(this.dialog[0]);
|
var div = jQuery(document.createElement("div")).append(this.dialog);
|
||||||
|
this.setDOMNode(div[0]);
|
||||||
|
|
||||||
var select_col = jQuery('#selection_col',dialog).children();
|
var select_col = jQuery('#selection_col',dialog).children();
|
||||||
var selected = jQuery('#selected', select_col);
|
var selected = jQuery('#selected', select_col);
|
||||||
@ -290,7 +295,7 @@ var et2_selectAccount = et2_selectbox.extend({
|
|||||||
var search = this.search = jQuery(document.createElement("div"));
|
var search = this.search = jQuery(document.createElement("div"));
|
||||||
|
|
||||||
var search_widget = this.search_widget = et2_createWidget('link-entry', {
|
var search_widget = this.search_widget = et2_createWidget('link-entry', {
|
||||||
'application': 'home-accounts',
|
'only_app': 'home-accounts',
|
||||||
'query': function(request, response) {
|
'query': function(request, response) {
|
||||||
// Clear previous search results for multi-select
|
// Clear previous search results for multi-select
|
||||||
if(!request.options)
|
if(!request.options)
|
||||||
|
Loading…
Reference in New Issue
Block a user