mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 08:23:12 +01:00
Update nm query when column selection changes, re-query only when columns added
This commit is contained in:
parent
3c1bebf3f1
commit
4c593038b0
@ -352,7 +352,10 @@ var et2_nextmatch = et2_DOMWidget.extend(et2_IResizeable, {
|
|||||||
*/
|
*/
|
||||||
_updateUserPreferences: function() {
|
_updateUserPreferences: function() {
|
||||||
var colMgr = this.dataviewContainer.getColumnMgr()
|
var colMgr = this.dataviewContainer.getColumnMgr()
|
||||||
if(this.options.settings.columnselection_pref) {
|
if(!this.options.settings.columnselection_pref) {
|
||||||
|
this.options.settings.columnselection_pref = this.options.template;
|
||||||
|
}
|
||||||
|
|
||||||
var visibility = colMgr.getColumnVisibilitySet();
|
var visibility = colMgr.getColumnVisibilitySet();
|
||||||
var colDisplay = [];
|
var colDisplay = [];
|
||||||
var colSize = {};
|
var colSize = {};
|
||||||
@ -379,6 +382,24 @@ var et2_nextmatch = et2_DOMWidget.extend(et2_IResizeable, {
|
|||||||
|
|
||||||
// Save adjusted column sizes
|
// Save adjusted column sizes
|
||||||
egw.set_preference(app, "nextmatch-"+this.options.settings.columnselection_pref+"-size", colSize);
|
egw.set_preference(app, "nextmatch-"+this.options.settings.columnselection_pref+"-size", colSize);
|
||||||
|
|
||||||
|
// Update query value, so data source can use visible columns to exclude expensive sub-queries
|
||||||
|
var oldCols = this.activeFilters.selectcols ? this.activeFilters.selectcols : [];
|
||||||
|
this.activeFilters.selectcols = colDisplay;
|
||||||
|
|
||||||
|
// We don't need to re-query if they've removed a column
|
||||||
|
var changed = [];
|
||||||
|
ColLoop:
|
||||||
|
for(var i = 0; i < colDisplay.length; i++)
|
||||||
|
{
|
||||||
|
for(var j = 0; j < oldCols.length; j++) {
|
||||||
|
if(colDisplay[i] == oldCols[j]) continue ColLoop;
|
||||||
|
}
|
||||||
|
changed.push(colDisplay[i]);
|
||||||
|
}
|
||||||
|
if(changed.length)
|
||||||
|
{
|
||||||
|
this.applyFilters();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user