Skip to content

Infragistics Community Forum / Web / Ignite UI for jQuery / igGrid – Setting the widths of columns programatically

igGrid – Setting the widths of columns programatically

New Discussion
Kiran Kumar Lakshmin
Kiran Kumar Lakshmin asked on Aug 31, 2019 10:32 AM

Hi,

I need to capture the current width columns of the igGrid (resizing enabled) and set them back to the grid on some action after some time. The grids have virtualization enabled and are have continuous mode.

We are using 2013.2 version of ignite ui controls.

Please suggest the right of capturing and setting the widths of columns programmatically.

Thanks,

Kiran Kumar L

Sign In to post a reply

Replies

  • 0
    Martin Pavlov
    Martin Pavlov answered on Nov 7, 2014 10:26 PM

    Hello Kiran,

    In order to capture columns width you can clone the current grid column configuration using $("#selector").igGrid("option", "columns"); code. Then you can use it to re-create the grid when you need to restore the columns widths. Keep in mind that re-creating the grid will reset its scroll position or an alternative approach is cycle through the columns collection and use the igGridResizing.resize API to set the column's width individually at run-time.

    Hope this helps,
    Martin Pavlov
    Infragistics, Inc. 

    • 0
      Akhil G
      Akhil G answered on Aug 31, 2019 10:32 AM

      Hi,

      When I am, setting the new columns with $("#selector").igGrid("option", "columns"); code, I am getting an error, The remote request to retrieve data failed:  ( abort )  always. Please help me what is the reason for it.?

  • 0
    [Infragistics] Surya
    [Infragistics] Surya answered on Nov 12, 2014 10:44 PM

    Hello Kiran Kumar,

    Please let us know if you have any further questions regarding this matter.

    • 0
      Kiran Kumar Lakshmin
      Kiran Kumar Lakshmin answered on Nov 19, 2014 9:49 AM

      Hi,

      We tried the steps suggested by you, and works fine when the width is specified in pixel.

      But in our application we have the grid where the column width is specified in percent and found its not working as expected.

      $(".selector").igGridResizing("resize", 0, columnWidth);
      Please suggest.
      Thanks,
      Veena
      • 0
        Martin Pavlov
        Martin Pavlov answered on Nov 19, 2014 4:31 PM

        Hello Veena,

        The resize method works with arguments in pixels. This is clearly stated in our API docs. What you can do is to manually convert the new column width from percents to pixels and then use the resize method. We will evaluate whether we can improve this API to work directly with arguments in percents.

        Hope this helps,
        Martin Pavlov
        Infragistics, Inc. 

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Kiran Kumar Lakshmin
Favorites
0
Replies
5
Created On
Aug 31, 2019
Last Post
7 years, 1 month ago

Suggested Discussions

Tags

Created on

Aug 31, 2019 10:32 AM

Last activity on

Aug 31, 2019 10:32 AM