Getting the jQuery selector element

4 posts, 1 answers
  1. Phil H.
    Phil H. avatar
    88 posts
    Member since:
    Nov 2008

    Posted 21 Jun 2014 Link to this post

    Hi:
    The following uses a jQuery selector to kick kendo off.  Can I get the value of that selector, so that I may do jQuery stuff with it.
    <div id ="listView2"></div>
    <script>
        $("#listView2").kendoListView({
            dataSource: { data: [ { name: "Jane Doe" }, { name: "John Doe" }] },
            template: "<div>#:name#</div>"
        });
    </script>

    Phil
  2. Phil H.
    Phil H. avatar
    88 posts
    Member since:
    Nov 2008

    Posted 22 Jun 2014 in reply to Phil H. Link to this post

    Hi:
    I referring to within an event method inside the ListView widget.  element does not appear to be a jQuery selector.
    Phil
  3. Kendo UI is VS 2017 Ready
  4. Answer
    Petyo
    Admin
    Petyo avatar
    2438 posts

    Posted 24 Jun 2014 Link to this post

    Hi,

    If I understand you correctly, the element field of the listview is a jQuery object instance and what you are looking for - see this test for what I mean.

    Regards,
    Petyo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  5. Phil H.
    Phil H. avatar
    88 posts
    Member since:
    Nov 2008

    Posted 29 Jun 2014 in reply to Petyo Link to this post

    Hi All
    Thanks Petyo.  This is what Petyo wrote:
    <div id="listView"></div>
    <script>
    $("#listView").kendoListView({
      template: "<div>#: name#</div>",
      dataSource: [ { name: "John Doe", age: 30 } ],
      dataBinding: function(e) {
         console.log(e.sender.element instanceof $);
      }
    });
    Phil
Back to Top
Kendo UI is VS 2017 Ready