forked from extern/egroupware
If a custom field is added to the column list, invalidate known columns to get all new data back, in case app did not send custom fields in the first request. Fixes needing to reload after displaying custom fields in nextmatch
This commit is contained in:
parent
7a1d2dc0cd
commit
ed6013605e
@ -874,18 +874,11 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput],
|
|||||||
// Server side wants each cf listed as a seperate column
|
// Server side wants each cf listed as a seperate column
|
||||||
jQuery.merge(colDisplay, custom_fields);
|
jQuery.merge(colDisplay, custom_fields);
|
||||||
|
|
||||||
// Save visible columns
|
|
||||||
// 'nextmatch-' prefix is there in preference name, but not in setting, so add it in
|
|
||||||
egw.set_preference(app, pref, colDisplay.join(","));
|
|
||||||
|
|
||||||
// Save adjusted column sizes
|
|
||||||
egw.set_preference(app, pref+"-size", colSize);
|
|
||||||
|
|
||||||
// Update query value, so data source can use visible columns to exclude expensive sub-queries
|
// Update query value, so data source can use visible columns to exclude expensive sub-queries
|
||||||
var oldCols = this.activeFilters.selectcols ? this.activeFilters.selectcols : [];
|
var oldCols = this.activeFilters.selectcols ? this.activeFilters.selectcols : [];
|
||||||
|
|
||||||
this.activeFilters.selectcols = colDisplay;
|
this.activeFilters.selectcols = colDisplay;
|
||||||
|
|
||||||
// We don't need to re-query if they've removed a column
|
// We don't need to re-query if they've removed a column
|
||||||
var changed = [];
|
var changed = [];
|
||||||
ColLoop:
|
ColLoop:
|
||||||
@ -896,10 +889,27 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput],
|
|||||||
}
|
}
|
||||||
changed.push(colDisplay[i]);
|
changed.push(colDisplay[i]);
|
||||||
}
|
}
|
||||||
if(changed.length)
|
|
||||||
{
|
// If a custom field column was added, throw away cache to deal with
|
||||||
this.applyFilters();
|
// efficient apps that didn't send all custom fields in the first request
|
||||||
}
|
var cf_added = $j(changed).filter($j(custom_fields)).length > 0;
|
||||||
|
|
||||||
|
// Save visible columns
|
||||||
|
// 'nextmatch-' prefix is there in preference name, but not in setting, so add it in
|
||||||
|
this.egw().set_preference(app, pref, colDisplay.join(","),
|
||||||
|
// Use callback after the preference gets set to trigger refresh, in case app
|
||||||
|
// isn't looking at selectcols and just uses preference
|
||||||
|
cf_added ? jQuery.proxy(function() {this.controller.update(true);}, this):null
|
||||||
|
);
|
||||||
|
|
||||||
|
// Save adjusted column sizes
|
||||||
|
this.egw().set_preference(app, pref+"-size", colSize);
|
||||||
|
|
||||||
|
// No significant change (just normal columns shown) and no need to wait,
|
||||||
|
// but the grid still needs to be redrawn if a custom field was removed because
|
||||||
|
// the cell content changed. This is a cheaper refresh than the callback,
|
||||||
|
// this.controller.update(true)
|
||||||
|
if((changed.length || custom_fields.length) && !cf_added) this.applyFilters();
|
||||||
},
|
},
|
||||||
|
|
||||||
_parseHeaderRow: function(_row, _colData) {
|
_parseHeaderRow: function(_row, _colData) {
|
||||||
|
Loading…
Reference in New Issue
Block a user