select

Gets/sets the selected ListView item(s).

Example

<button class="k-button" id="selectBtn">Select First Item</button>
<div id="listView"></div>

<script type="text/x-kendo-tmpl" id="template">
    <div class="product-view k-widget">
        <dl>
            <dt>Product Name</dt>
            <dd>#:ProductName#</dd>
  </dl>
  </div>
</script>

<script>
  var crudServiceBaseUrl = "https://demos.telerik.com/kendo-ui/service",
      dataSource = new kendo.data.DataSource({
        transport: {
          read:  {
            url: crudServiceBaseUrl + "/Products",
            dataType: "jsonp"
          }
        },
        pageSize: 10
      });

  var listView = $("#listView").kendoListView({
    dataSource: dataSource,
    selectable: "multiple",
    template: kendo.template($("#template").html())
  }).data("kendoListView");

  $("#selectBtn").click(function(){
    // get a reference to the ListView widget
    var listView = $("#listView").data("kendoListView");
    // selects first ListView item
    listView.select(listView.content.children().first());
  });
</script>

Returns

jQuery The selected items if called without arguments.

Parameters

items jQuery | Array

Items to select.

In this article