Declined
Last Updated: 19 Oct 2021 05:50 by ADMIN
cluengas
Created on: 16 Feb 2015 22:58
Category: Kendo UI for jQuery
Type: Feature Request
4
Chainable Setters
For setters in general this shouldn't cause any trouble to return the widget so I could perform more things with it.

For the get-set functions (like value() etc..), if I get a parameter this means I'm using it as a setter hence I might want to do something else with the widget later on... "Chainability" jQuery style.

A small code snippet to illustrate:
//the datePicker is already in place and has been initialized somewhere else
//I would like to be able to do this:
datePicker = $("#aDatePicker") //jQuery Selector
  .getKendoDatePicker() //retrieve the picker
  .setOptions(dpOptions) //set new options
  .value(aDate); //set the current date

//Instead of this:
datepicker = $("#aDatePicker").getKendoDatePicker();
datepicker.setOptions(dpOptions);
datepicker.value(aDate);

Regards
Carlos A Luengas
1 comment
ADMIN
Ianko
Posted on: 19 Oct 2021 05:50

Hello,

Chain-ability in the Kendo components' API cannot be utilized as most of the API methods are used as getters and setters and thus chain-ability would easily break. However, there are methods that offer that functionality and those methods are documented in the API. 

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.