How to get Selected Item's index in KendoMobileListView

1 posts, 0 answers
  1. Pourya
    Pourya avatar
    2 posts
    Member since:
    Sep 2012

    Posted 11 Sep 2012 Link to this post

    Hi, I am using KendoMobileListView and I want to know how I can get the index of selected Item. My DataSource contains multiple entries and I want to be able to find out the index of selected item to show appropriate data

    $('#Template').kendoMobileListView({       
            dataSource: EmployeeVisitsInfo,
            template: '<table  style="width: 100%"><tr><td><p>${a = (typeof data.Name !== "undefined") ?Name : data.LastName</td></table>',
            click:  function(e){
              var datasource = $('#Template').data("kendoMobileListView");
              var index = datasource .select().index();
              var dataItem = ds.dataSource.view()[index];
              console.log(index)
            }
        });

    I dont think this is the right way to get the index of selected item because i am keep getting and error saying :

    Uncaught TypeError: Object [object Object] has no method 'select'  

    Any Idea how I can go about doing this ? Thank you
Back to Top