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

Multiple display:none with setOptions

4 Answers 758 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 31 Jan 2017, 01:10 PM

Hi there,

I'm having a problem with Kendo Grid UI and setOptions. When I setOptions, hidden fields have an extra display:none attribute added. I've attached an image of my options variable (data.selectedGridState) compared with the the getOptions value directly after the setOptions command. I believe they should be identical. Could you advise?

My code looks like this:
var selectedGrid = $(jQuerySelectors.selectedMembersGrid).data("kendoGrid");
selectedGrid.setOptions(JSON.parse(data.selectedGridState));

Kind regards,
Karl

4 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 02 Feb 2017, 11:20 AM
Hello Karl,

I was able to observe the same behaviour.

After additional investigation, I can confirm that this occurs because of the hidden property of the Grid which will add one additional display: "none" attribute.

Also, when the hidden property on the column is used, there is no need of manually setting the display: "none" attribute as the column will be hidden:

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.hidden

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
0
Karl
Top achievements
Rank 1
answered on 02 Feb 2017, 12:52 PM

Thanks for getting back to me, Stefan. 

My use case for this is storing the grid options in a database. It seems that in order to do this without collecting "display:none;"s, I need to manually remove any display attributes prior to saving the state. Would you consider this a bug with the Kendo Grid?

Kind regards,
Karl

0
Accepted
Stefan
Telerik team
answered on 06 Feb 2017, 07:41 AM
Hello Karl,

As this style is connected to the hidden property, it is expected.

Still, I can confirm that in scenarios like this one can create an undesired result.

I will forward this to the developer team for consideration.

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
0
Karl
Top achievements
Rank 1
answered on 07 Feb 2017, 09:29 AM

Thanks Stefan,

I'll close this ticket, then.

Kind regards,

Karl

Tags
Grid
Asked by
Karl
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Karl
Top achievements
Rank 1
Share this question
or