New
Last Updated: 21 Jun 2018 10:15 by ADMIN
Tim
Created on: 22 Feb 2018 18:12
Category: Kendo UI for jQuery
Type: Feature Request
4
Add methods to allow any property to be changed after initialization
There are many properties that can be set during initialization that cannot be changed through the API afterwards.

Take the Kendo UI ToolBar for example. You can add a button to the toolbar and set the text, but you cannot change the text afterwards unless you update the element directly. It may seem like a simple thing to change the text of an element, like so: $("#myButton").text("New Text"). However, if you had set the imageUrl as well, setting the text like I did above would remove the image. Knowing that, you could get the text node and update the nodeValue. That may work today but could easily be broken during a Kendo UI update (for example, if the update included a change that wraps the text in a span).

Having to deal with native elements after they have been created by the Kendo UI components is a dangerous practice for developers as it requires an internal knowledge of how elements are rendered based on the different options set. As mentioned above, it is also dangerous as any update could break our code. Therefore, it is imperative to expose methods that allow us to modify any properties through the API (where possible) to allow us to create clean and easy to maintain code.

If you search the feedback, you will see many requests to add a method here and a method there. There is even a related one to this called "Kendo Mobile: Methods to set properties dynamically".

Suggestion: When you have child elements, such as buttons on the toolbar, please allow us to update those widgets directly rather than through the parent. For example, instead of $("#myToolbar").data("kendoToolBar").enable("#myButton"), allow us to do something like this $("#myButton").data("kendoToolBarItem").enable();
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments