New method chaining

3 posts, 0 answers
  1. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 15 May 2012 Link to this post

    Reference Url

    $("#grid").kendoGrid();
    $("#grid").data("kendoGrid").refresh();

    All of this ceremony caused frustration and so we decided to eliminate it by supporting method chaining. With this latest service pack, you'll be able to write JavaScript that's more readable:

    $("grid").kendoGrid("refresh");

    ------------------------------------------
    So what's the deal here?  We're to pass in method names as a string?  Cant just do...?
    $("#grid").kendoGrid().refresh();
    
  2. Dr.YSG
    Dr.YSG avatar
    210 posts
    Member since:
    Dec 2009

    Posted 16 May 2012 Link to this post

    I was about to post the same question.

    1. Does chaining mean that I get a result from the constructor that I can chain methods to (ala JQuery?)
    var myGrid = $("#grid").kendoGrid();
    And this seems to be a different pattern for method invocation, does it allow parameters? what is the philosophy here?  
    $("grid").kendoGrid("refresh");
  3. Kendo UI is VS 2017 Ready
  4. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 16 May 2012 Link to this post

    @Doc,
      Here's a fiddle to play with...

    http://jsfiddle.net/stevescotthome/mf9ED/6/

Back to Top