jQuery UI Widgets › Forums › Grid › automatic column width problem
This topic contains 2 replies, has 2 voices, and was last updated by admin 2 weeks, 2 days ago.
-
Author
-
Hi, when I use
$('#jqxgrid').jqxGrid('autoresizecolumns');
I want some columns to be excluded from this process.but it expands all columns equally.for example the row sequence number column of the grid should remain fixed.I didresizable:false
but it didn’t work.actually the columns with false should be excluded.and you can see in the example in a problem, there is a small gap next to the column at the end.one question I have is how can I turn the columns back to the old state by resetting after the user changes the column widths? for this, I keep the old width of the column in the forced session while resizing. However, there must be a simpler way.
thanks
I am using the latest version{ text: '', pinned: true, sortable: false, filterable: false, editable: false, groupable: false, draggable: false, resizable: false, datafield: 'ROW_NUMBER', columntype: 'number', width: '3%', cellsrenderer: function (row, column, value) { return "<div style='font-size: 13px;margin: 4px;position: relative;text-align: center;'>" + (value + 1) + "</div>"; }
And why is there a gap? For example, if you look at this, when I resize 3 columns, there is a gap, but if I do not write the width of a column or all columns, it is equal and there is no gap. The logical thing is that if all columns are not given width, it separates equally, but if the width of a column is deleted, it separates equally again. As I wrote above, if the width of ROW_NUMBER is fixed, its width should be subtracted from the width of the grid and the remaining number should be divided equally to the other columns. If I do not write the width of the grid “100%” and make it fixed “500”, there is no gap problem.
I could not understand the logic,- This reply was modified 2 weeks, 2 days ago by Serdar.
- This reply was modified 2 weeks, 2 days ago by Serdar.
- This reply was modified 2 weeks, 2 days ago by Serdar.
- This reply was modified 2 weeks, 2 days ago by Serdar.
- This reply was modified 2 weeks, 2 days ago by Serdar.
- This reply was modified 2 weeks, 2 days ago by Serdar.
- This reply was modified 2 weeks, 2 days ago by Serdar.
- This reply was modified 2 weeks, 2 days ago by Serdar.
- This reply was modified 2 weeks, 2 days ago by Serdar.
- This reply was modified 2 weeks, 2 days ago by Serdar.
- This reply was modified 2 weeks, 2 days ago by Serdar.
Hi Serdar,
You cannot exclude columns from this method. The ‘resizable’ property determines whether the column can be resized dynamically. The ‘autoresizecolumns’ method resizes all columns to best fit depending on the content in the columns. If you need to auto-size just some of the columns, consider using the ‘autoresizecolumn’ method.
Best regards,
Peter StoevjQWidgets Team
https://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.