Skip to content

Commit

Permalink
Merge pull request #41 from YouweGit/task/resizeColumnsAfterFiltering
Browse files Browse the repository at this point in the history
[TASK] Resize columns after filtering
  • Loading branch information
kjkooistra-youwe authored Jan 16, 2020
2 parents ce17234 + 75aae2b commit c9e56a9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Resources/public/js/pimcore/objects/tags/objectBridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ pimcore.object.tags.objectBridge = Class.create(pimcore.object.tags.objects, {
title = layout.title;
}

if (!this.fieldConfig.enableFiltering || filter.type === null) {
if (!this.fieldConfig.enableFiltering) {
filter = null;
}

Expand Down Expand Up @@ -465,7 +465,8 @@ pimcore.object.tags.objectBridge = Class.create(pimcore.object.tags.objects, {
var plugins = [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
}),'pimcore.gridfilters'
}),
'pimcore.gridfilters'
];

var selectionModel = 'Ext.selection.RowModel';
Expand All @@ -475,7 +476,6 @@ pimcore.object.tags.objectBridge = Class.create(pimcore.object.tags.objects, {

this.component = Ext.create('Ext.grid.Panel', {
store: this.store,
plugins: 'gridfilters',
border: true,
style: "margin-bottom: 10px",
enableDragDrop: true,
Expand Down Expand Up @@ -508,6 +508,13 @@ pimcore.object.tags.objectBridge = Class.create(pimcore.object.tags.objects, {
}
if (this.fieldConfig.autoResize) {
this.component.view.addListener('refresh', this.onRefreshComponent.bind(this));

// Trigger refresh to autoresize columns again after filtering
if (this.fieldConfig.enableFiltering) {
this.component.addListener('filterchange', function () {
this.component.view.refresh();
}.bind(this));
}
}

this.component.reference = this;
Expand Down

0 comments on commit c9e56a9

Please sign in to comment.