This repository has been archived by the owner on Apr 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 325
Column resizes on editing #489
Labels
Comments
Hello there, I ran into this myself. Here is a hacky subclass I ended up using to lock the width of the cell on enter/exit edit mode. Hope this helps someone! ( @kevcampb ) var FixedWidthEditorCell = Backgrid.Cell.extend({
enterEditMode: function () {
this.$el.width((this.$el.outerWidth()) + 'px');
Backgrid.Cell.prototype.enterEditMode.apply(this, arguments);
},
exitEditMode: function () {
this.$el.width(false);
Backgrid.Cell.prototype.exitEditMode.apply(this, arguments);
}
}); Also, big thanks to @wyuenho for Backgrid in general, really great stuff! |
I was a while fighting with this and the only solution that could find was modify compiled backgrid.js. The approach is capture cell width, insert editor, set cell an editor width. Editing cell "enterEditMode" function as this:
my modifications are between "mod 1" and "mod 2" comments. anyway some times it shows 1 or 2 px move on editing some column. this is a very, very good control, but indeed this is a bad effect. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If you look at the world population example on backgridjs.com, selecting the Population field results in the column getting larger whilst the editor is open. I think it would feel better if this didn't happen.
I've scoured the issues list, but can't seem to find an explicit reference to this. Looking at the code, I have a feeling there is some issue with putting an input field in a table and using size:auto.
Is the resizing a deliberate decision, or was it something that would be tough to resolve?
The text was updated successfully, but these errors were encountered: