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

How to get Selected Item's index in KendoMobileListView

0 Answers 220 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Pourya
Top achievements
Rank 1
Pourya asked on 11 Sep 2012, 02:16 PM
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

No answers yet. Maybe you can help?

Tags
ListView (Mobile)
Asked by
Pourya
Top achievements
Rank 1
Share this question
or