Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need ability to skip sizing of some columns (Checkbox row) #69

Open
millebi opened this issue Feb 10, 2017 · 0 comments
Open

Need ability to skip sizing of some columns (Checkbox row) #69

millebi opened this issue Feb 10, 2017 · 0 comments

Comments

@millebi
Copy link

millebi commented Feb 10, 2017

If a table has a column that contains just a checkbox (for selection of multiple of rows) or action icons these columns can be resized to strange results (user can make it huge or tiny, automatic sizing can cut off the checkbox, etc...). I've done a rudimentary change in an older version that probably can be done better. Here's what I have:

Call to setup (don't resize column 0, or 6):
this.$el.find("table").resizableColumns({fixed:[0,6]});

Functionality change:
ResizableColumns.prototype.assignPercentageWidths = function() {
return this.$tableHeaders.each((function(_this) {
var ccnt = 0;
return function(_, el) {
var $el, l = _this.options.fixed;
$el = $(el);
if(l) {
for(var i=0; i < l.length; i++) {
if(ccnt == l[i]) return
}
}
return setWidth($el[0], $el.outerWidth() / _this.$table.width() * 100, ccnt++);
};
})(this));
};

If there was a method to disallow automatically resizing some columns or disabling resizing of some columns, I couldn't find it and maybe someone else can make this even better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant