jQWidgets Forums
jQuery UI Widgets › Forums › Grid › grid column resize
Tagged: jqxGrid ;
This topic contains 3 replies, has 2 voices, and was last updated by Martin 6 years, 7 months ago.
-
Authorgrid column resize Posts
-
Hi,
When I double click on the column border, it resizes it. But I have implemented cellsrenderer function that has an image in the cell. So when I double click on the column border, it kind of hides the image. Is there a way to set the width it should set on double clicking the column border?
Second, I have a context menu on the grid. right now I am checking the event. ClinetY’s value (line #122)so that the context menu does not appear on the header. But this looks fragile. I mean, if in future there are some changes to the header or margin, I have to change the check as well. Is there a better way to do this?I have attached a link:
https://jseditor.io/?key=javascript-app-ver-6.
Regards
Hello priyamsharma2704,
Double clicking on the column’s border auto-resizes the column depending on its content.
You cannot set width for the auto resize, but you can bind to thecolumnresized
event and check if the new width is too small and needs to be resized again. You can also disable the auto resize functionality by settingcolumnsautoresize
to false.
For the context menu, this is the way for preventing it from opening in the header.Best Regards,
MartinjQWidgets Team
http://www.jqwidgets.com/Since the auto-resizing the column depends on its content, then why the image is getting clipped off for 2nd col & 2nd row? And one more thing, When I click on the drop down (2nd row), the menu takes the width of the cell. But after selecting an option from drop down menu, when I change the width of the column and then again click on the drop down, its width remains same. Width of drop down menu does not changes according to the width of the column. Do you have any idea about this? Please refer the same jseditor link mentioned in above post.
Regards
Hello priyamsharma2704,
You can invoke the
render
method in thecolumnresized
event handler. This will resize the drop drown width when the column width is changed.$("#grid").on('columnresized', function (event) { $('#grid').jqxGrid('render'); });
As for the auto-resizing with the image, you can check from the same handler’s parameter if the new width is too small and resize it.
Best Regards,
MartinjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.