This is a migrated thread and some comments may be shown as answers.

Reset column width when navigating from one grid compoenent to another

1 Answer 386 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sree Divya
Top achievements
Rank 1
Sree Divya asked on 01 Oct 2018, 07:36 PM

While navigating from grid component to another grid component ,since angular doesn't recreate the whole component  as it is the same path, I expected the table generated not to store previous grid setting.

For example:- if I resize the column on the current grid and I navigate to the next grid, the component is still storing the old resize value.

Solutions I tried:

1. Used columnResize event to know the old width and, I tried to reset the width by setting the style attribute with oldWidth.

2. Tried to recreate the grid table by using Structural directives like *ngIf as well but the table was not being recreated.

Please advise on how to proceed.

 

 

1 Answer, 1 is accepted

Sort by
0
Svet
Telerik team
answered on 03 Oct 2018, 08:17 AM
Hi Sree,

We can set default widths of the columns and each time we navigate to a new grid we can restore the default widths. For the purpose we can use the [width] input property of the column component.

I hope this helps. In case further assistance is required for this case, could you provide some more information about the use case scenario. Thank you in advance. 

Regards,
Svetlin
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
Sree Divya
Top achievements
Rank 1
Answers by
Svet
Telerik team
Share this question
or