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

Widget Destroy methods

8 Answers 370 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Redsquare
Top achievements
Rank 1
Redsquare asked on 21 Feb 2012, 07:29 PM
Hi, I was wondering why you do not have destroy methods for the widgets.Controls like the grid do apply multiple extra divs to the body and it is a pain when developing a 'single page app' to try and keep the dom tidy when rendering different views.

Thanks

8 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 22 Feb 2012, 10:36 AM
Hi Steve,

I am afraid to say that we do not have a destroy method yet.

Your suggestion is meaningful and what is more important - such method would be useful, however at this stage developers are working on most popular feature requests. We really appreciate that you submitted your idea at our uservoice page, but its implementation depends on the users feedback and the number of votes.

All the best,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Redsquare
Top achievements
Rank 1
answered on 22 Feb 2012, 07:47 PM
But this is quite key when developing apps that have to ensure that their footprint is low and response rates are kept high throughout a long running session. The popup widgets should really re-use a single container rather than create duplicates and creating lots of extra load in the dom. This is more of a bug than anything since if i remove a grid element it does not actually remove the grid and associated controls. I dont see it getting lots of traction on user voice so I hope you see the value in this for people who want to create serious business apps. When I have a few grids on screen at once I see 60+ extra elements appended to the dom when it could be done with 2.
0
Accepted
Atanas Korchev
Telerik team
answered on 23 Feb 2012, 08:32 AM
Hello,

 The extra elements are created by the filtering menu. The dropdowns inside it have a popup of their own which too needs to be appended at the end of the BODY for proper positioning. Reusing the popup is not really an option because different dropdowns have different options. Creating the whole popup with all  items every time the user opens the dropdown would introduce a significant performance hit and browser reflow.

Don't get us wrong. The destroy method is a very good idea but we just can't implement it right away. The feature set for the next release has been frozen long ago and we can't add more to it.

All the best,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Redsquare
Top achievements
Rank 1
answered on 23 Feb 2012, 12:25 PM
Ok, fair enough. Have you got any hint how I might be able to query these extra elements to see which widget they belong to? Is this contained in a data attribute on the grid/grid-column etc? I cannot do a global remove of .k-popup elements as this breaks long lived widgets on the screen. If I can find out which elements belong to which widget I can roll a clean up method.
0
Atanas Korchev
Telerik team
answered on 24 Feb 2012, 08:48 AM
Hello,

 I created a jsFiddle demo which shows how to do that. 

Kind regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Redsquare
Top achievements
Rank 1
answered on 24 Feb 2012, 10:15 AM
Atanas Korchev , thanks for this. It will be a slow mopup but better than my current hack.

Thanks
0
Atanas Korchev
Telerik team
answered on 24 Feb 2012, 10:20 AM
Hi,

 Why do you think this would be slow? This is actually how we would implement the destroy method in the future. I don't think there is a faster way.

All the best,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Redsquare
Top achievements
Rank 1
answered on 24 Feb 2012, 02:46 PM
It was more a joke, two jquery each's make me nervous! I have profiled it with 3 grids each with 20+ columns and it is fine:)

Cheers
Tags
Grid
Asked by
Redsquare
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Redsquare
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or