This is a migrated thread and some comments may be shown as answers.

Getting the jQuery selector element

3 Answers 156 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Phil H.
Top achievements
Rank 2
Phil H. asked on 21 Jun 2014, 09:53 PM
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

3 Answers, 1 is accepted

Sort by
0
Phil H.
Top achievements
Rank 2
answered on 22 Jun 2014, 12:39 PM
Hi:
I referring to within an event method inside the ListView widget.  element does not appear to be a jQuery selector.
Phil
0
Accepted
Petyo
Telerik team
answered on 24 Jun 2014, 02:49 PM
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!
 
0
Phil H.
Top achievements
Rank 2
answered on 29 Jun 2014, 02:09 PM
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
Tags
ListView
Asked by
Phil H.
Top achievements
Rank 2
Answers by
Phil H.
Top achievements
Rank 2
Petyo
Telerik team
Share this question
or