(1) Summary of Kendo UI Data Binding types

Source: Internet
Author: User

============================= AutoComplete automatically complete binding ============ <SCRIPT> $ ("# AutoComplete"). kendoautocomplete (["Apples", "oranges", "Grapes"]);Obtain the reference object var AutoComplete =$ ("# AutoComplete "). data ("kendoautocomplete"); this reference object operates autocomplete. value ("Cherries"); VaR value = autocomplete. value (); =============================== bind a function to obtain the attributes of this class ====================== ================= var viewmodel = Kendo. observable ({name: "John Doe", displaygreeting: function () {var name = This. get ("name"); // This. get this method this. set ("name", "yzs"); // This. set this method alert ("hello," + name + "!!! ") ;}}); Kendo. BIND (document. body, viewmodel); if it is outside the class (after bind), operate with the instantiated object name, such as viewmodel. get ("name"); viewmodel. set ("name", "yzs1013 "); ========================================================== ===== use AutoComplete to listen ============================== ====================================== Grid binding ============ ========================================================== =============== datepicker binding ================================ ================ <title>Kendo UI Web</title> ========================================================== Jquery obtains data binding ========================================================== =============$ (document ). ready (function () {$. ajax ({type: 'get', async: false, URL: "http://t.sogx.cn/wap/index.php? M = user & C = show & id = 2 ", data:" ajax = 1 ", datatype:" jsonp ", success: function (OBJ) {var viewmode5222 = Kendo. observable ({data2: obj. data}); Kendo. BIND ($ ("# drawer-resume"), viewmode5222 );}})}); ================================================== some experience ========================================================== binding time 1. kendoui template data #, which can be found in the data source 2. the data source format (one-dimensional or multi-dimensional) must match. If the preceding conditions are not met, the binding fails, and a blank error is displayed. Bind a kendo datasource to Kendo. observable object: var formvm = Kendo. observable ({sources: formds, source: NULL}); bind the specified formvm to a div element: Kendo. BIND ($ ("# form_div"), formvm); when the page data changes, update the bound data source (datasource): formds. BIND ("change", function () {formvm. set ("Source", this. view () [0]);}); force update the value in form_div: formvm. set ("source. username ", 'gloomyfish '); the corresponding HTML is

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.