mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 17:14:36 +01:00
Implement customfilter to work with link-entry at least
This commit is contained in:
parent
bfa9b03115
commit
fc14dba964
@ -100,7 +100,10 @@ var et2_nextmatch = et2_DOMWidget.extend(et2_IResizeable, {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var global_data = this.getArrayMgr("modifications").getRoot().getEntry('~custom_fields~');
|
var global_data = this.getArrayMgr("modifications").getRoot().getEntry('~custom_fields~');
|
||||||
global_data.fields = cfs;
|
if(typeof global_data !== 'undefined')
|
||||||
|
{
|
||||||
|
global_data.fields = cfs;
|
||||||
|
}
|
||||||
|
|
||||||
this.div = $j(document.createElement("div"))
|
this.div = $j(document.createElement("div"))
|
||||||
.addClass("et2_nextmatch");
|
.addClass("et2_nextmatch");
|
||||||
@ -1186,9 +1189,7 @@ var et2_nextmatch_header = et2_baseWidget.extend(et2_INextmatchHeader, {
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
et2_register_widget(et2_nextmatch_header, ['nextmatch-header']);
|
||||||
et2_register_widget(et2_nextmatch_header, ['nextmatch-header',
|
|
||||||
'nextmatch-customfilter']);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extend header to process customfields
|
* Extend header to process customfields
|
||||||
@ -1461,7 +1462,18 @@ 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) {
|
||||||
this.nextmatch.activeFilters["col_filter"][this.id] = selected.item.value;
|
if(event.data.options.application)
|
||||||
|
{
|
||||||
|
// Only one application, just give the ID
|
||||||
|
this.nextmatch.activeFilters["col_filter"][this.id] = selected.item.value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// App is expecting app:id
|
||||||
|
this.nextmatch.activeFilters["col_filter"][this.id] =
|
||||||
|
event.data.app_select.val() + ":"+ selected.item.value;
|
||||||
|
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
delete (this.nextmatch.activeFilters["col_filter"][this.id]);
|
delete (this.nextmatch.activeFilters["col_filter"][this.id]);
|
||||||
}
|
}
|
||||||
@ -1486,3 +1498,47 @@ var et2_nextmatch_entryheader = et2_link_entry.extend(et2_INextmatchHeader, {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
et2_register_widget(et2_nextmatch_entryheader, ['nextmatch-entryheader']);
|
et2_register_widget(et2_nextmatch_entryheader, ['nextmatch-entryheader']);
|
||||||
|
|
||||||
|
|
||||||
|
var et2_nextmatch_customfilter = et2_nextmatch_filterheader.extend({
|
||||||
|
attributes: {
|
||||||
|
"widget_type": {
|
||||||
|
"name": "Actual type",
|
||||||
|
"type": "string",
|
||||||
|
"description": "The actual type of widget you should use"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
legacyOptions: ["widget_type"],
|
||||||
|
|
||||||
|
real_node: null,
|
||||||
|
|
||||||
|
init: function(_parent, _attrs) {
|
||||||
|
this._super.apply(this, arguments);
|
||||||
|
|
||||||
|
switch(_attrs.widget_type)
|
||||||
|
{
|
||||||
|
case "link-entry":
|
||||||
|
_attrs.type = 'nextmatch-entryheader';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this.real_node = et2_createWidget(_attrs.type, _attrs, this._parent);
|
||||||
|
},
|
||||||
|
|
||||||
|
// Just pass the real DOM node through, in case anybody asks
|
||||||
|
getDOMNode: function(_sender) {
|
||||||
|
return this.real_node ? this.real_node.getDOMNode(_sender) : null;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Also need to pass through real children
|
||||||
|
getChildren: function() {
|
||||||
|
return this.real_node.getChildren();
|
||||||
|
},
|
||||||
|
setNextmatch: function(_nextmatch)
|
||||||
|
{
|
||||||
|
if(this.real_node && this.real_node.setNextmatch)
|
||||||
|
{
|
||||||
|
return this.real_node.setNextmatch(_nextmatch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
et2_register_widget(et2_nextmatch_customfilter, ['nextmatch-customfilter']);
|
||||||
|
Loading…
Reference in New Issue
Block a user