Hi,
I know that with the event groupedColumnsChanged , i have access to some element of the plug-in. how can i call the resize function from there ?
I tried ui.owner.resize or ui.owner.grid.resize and i get an error of undefined.
Thank you for you help
regards
Hello,
Thank you for using our forum.
About your question, resize method cannot be accessed through the ui parameter. Resize method is part of Resizing feature, so my suggestion is to access it through there.
http://help.infragistics.com/jQuery/2014.2/ui.iggridresizing#methods:resize
Online sample:
http://jsfiddle.net/zdravko/sce4v1a4/5/show/
The sample is showing how to resite the grouped column in groupedColumnsChanged event.
Code snippet:
features: [ { name: "GroupBy", groupedColumnsChanged: function (evt, ui) { if(ui.groupedColumns.count() != 0){ $("#" + ui.owner.grid.id()).igGridResizing("resize", ui.key, 100); }else{ $("#" + ui.owner.grid.id()).igGridResizing("resize", ui.key, 400); } } }, { name: "Resizing" } ],
Thank you for your answer, i've tried it and it almost worked, because what i tried to do is resize the column to 0. but even if a set it to 0, it still can see it. I know that i could use hideColumn instead, but i faced a problem when i tried to use the hideColumn method in my particular case, so i thought i could try this way.
So if i want to set by code the column to 0, what settings do i have to consider ? i haven't set the grid width, but i've set the columns width with percentage , do i have to use pixel instead ? do i have to recalculate the columns width after resizing one to 0 ?
thank you in advance for your help
It is not recommended to set column width to 0 in order to hide it. We provide build in feature for this kind of manipulation, so it would be highly appreciated if you give it a try. As I understand though you are facing some issues when using the Hiding feature. Could you please try to isolate the issue into the sample below and I will investigate it further for you.
http://jsfiddle.net/zdravko/sce4v1a4/6/show/
About your last questions, yes the width must be in pixels because our 'resize' method resize a column to a specified width in pixels only.