It's a relieve that we can use $('#grid').kendoGrid('refresh') already. Thank you guys! However, it still seems to be a problem when we need to get the instance of a created componente. For example, if you need to access the grid's thead element, the only possible way is through $('#grid').data('kendoGrid').thead. If I try do this the natural way, (e.g. $('#grid').kendoGrid().thead), my grid is reinitialized. That's a pain. The expected behavior for most experienced jQuery users is that if plugin is aready instantiated for a specific element, calling it's initializer method should return the instance, instead of creating it again. Other than that you guys have been brilliant. Never saw anything even close. As I said my coworkers, if KendoUI was a girl, I'd totally marry her. Keep up the good work =]
Hi Altenor,
I see your point of view and although this sounds reasonable it is against the design concept of the widgets to implement such behaviour. The initializing method is reserved only for initialization in order to preserve clarity and avoid overengineering the initialization of the component.
Although this concept is available for some small jQuery components out there as they are reinitializing themselves and return the instance. For complex components like Grid this would result in hectic behaviour within the component.
This is why it is decided to follow a strict separation of responsibilities for the extended jQuery methods and widgets' methods:
- kendoGrid - reserved only for initialization
- getKendoGrid / data("kendoGrid") / kendo.widgetInstance($("#grid")) - gets the widget instance
- setOptions - change widget options/reinitialize for some
Regards,
Ianko
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.