Telerik Forums
Kendo UI for jQuery Forum
0 answers
277 views
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
Pourya
Top achievements
Rank 1
 asked on 11 Sep 2012
0 answers
104 views
HI,
    I'm using the listview to act as a form in the same way you have in your demo's. I would like to be able to add some items dynamically to the end of the listview based on some code logic. Because this is not using a datasource as all the common items are declared in html code at designtime, how would I go about adding the extra non common items to listview.items() at runtime. 

Or I could use a dataSource but then how can I specify what template each item should have when they would not all want the same template.

Thanks 
Paul
Top achievements
Rank 1
 asked on 11 Sep 2012
0 answers
55 views
hello,

I  use the codeigniter php mvc.

I seed the Endless scrolling remote url is http://search.twitter.com/search.json?q=javascript&rpp=10&page=1

and page++ , but I use the codeigniter , it just work at like http://search.twitter.com/search.json/javascript/10/1 , can't use get parameter.

how can I solve it?

sorry for my bad english.
Vence
Top achievements
Rank 1
 asked on 11 Sep 2012
0 answers
67 views
Hi there,

I am doing a listview application which gets data from the server and - onclick - displays detail data for the current listview item.
When loading the first page of data from the server (the server id paging) everything works flawlessly. On clicking / touching the item the details page is provided with all the data from the record.
However, after scrolling down and (automatically) loading the 2nd page I am just able to get details data for the items from the 2nd page when clicking / touching them but not from the previous 1st one anymore. The details pages of the first page are simply empty.

Is this happening by design? Or am I doing sth. wrong? And if it's not my fault, will this be addressed in any next release?

regards,
Erik
d2uX
Top achievements
Rank 1
 asked on 10 Sep 2012
0 answers
40 views
Hi,
I test a sample in it as follows 
http://jsfiddle.net/7WVqL/106/ 
Detailbutton show abnormal 

Thanks
Max  
Max
Top achievements
Rank 1
 asked on 30 Aug 2012
0 answers
69 views
i created the listview but its not displaying radio button in safari browser, firefox is displaying correctly

this code we are using
<div data-role="modalview" style="width: 100%;" id="rcm-placement-nr-list" data-layout="checklayout">
            <ul id="menuList" data-role="listview" data-template="placementNRTemplate" data-click="placementNRSelected"
                data-source="placementNRDataSource"  data-style="inset">
            </ul>
        </div>

 var schema = { model: {} };

        var placementNRDataSource = kendo.data.DataSource.create({
            data: [
                        { text: "Select a Value", value: "-1" },
                        { text: "test 1 required", value: "1" },
                        { text: "test 2 Encounter", value: "2" },
                        { text: "test 3 only", value: "3"}],
            schema: schema

        });

can you please tell us how to fix this problem

Bini
Top achievements
Rank 1
 asked on 27 Aug 2012
0 answers
155 views
Hi everyone.

I have a listview that is populated from a remote datasource. What I need to do is populate a second list with relevant data from the item selected from the first list.

I can do it by "re-populating"
 the first list but this gives me errors later one when selecting something from the second list.

Long story short, I have a list of customers which is populated from an external datasource. Each customer record has an array of items "nested" within their data record. eg: 

{
  "ID": 3,
  "Name": "Sarah Carlson",
  "Telephone": "(011) 123 4567",
  "Address": "1 Test ave",
  "Suburb": "Test",
  "City": "Testville",
  "Province": "Gauteng",
  "Country": "South Africa",
  "PostalCode": "0001",
  "DeliveryStatus": "Pending",
  "Packages": [
    {
      "ID": 1,
      "Name": "Package 1",
      "Status": "Pending"
    },
    {
      "ID": 2,
      "Name": "Package 2",
      "Status": "Pending"
    }
  ]
}

What I need to do is, when the customer is selected, display a new list with the customer's packages on it with a combobox and a button for each package allowing the package status to be changed.

Here's my code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
    <title>Deliveries</title>
    <script src="js/jquery.min.js"></script>
    <script src="js/kendo.mobile.min.js"></script>
    <script src="js/console.js"></script>
    <link href="styles/kendo.common.min.css" rel="stylesheet" />
    <link href="styles/kendo.mobile.all.min.css" rel="stylesheet" />
</head>
<body>
    <a href="Index.html">Back</a>
   <div data-role="view" id="listview-customers" data-init="showCustomerList" data-title="Customers">
        <ul id="customer-listview">
        </ul>
    </div>
    <div data-role="view" id="listview-packages" data-title="Packages">
        <ul id="package-listview">
        </ul>
    </div>
    <div data-role="layout" data-id="databinding">
        <header data-role="header">
        <div data-role="navbar">
            <span data-role="view-title"></span>
            <a data-align="right" data-role="button" class="nav-button" href="Index.html">Home</a>
        </div>
    </header>
    </div>
    <script>
        var id;
        var packages;
        var packageDataSource = new kendo.data.DataSource({
            schema: {
                model: {
                    id: "ID",
                    fields: {
                        Name: { type: "string" },
                        Status: { type: "string" }
                    }
                }
            }
        });
 
        var dataSource = new kendo.data.DataSource({
            transport: {
                read: {
                    url: "http://localhost:8080/databases/shipping/docs",
                    dataType: "json",
                    data: {
                        q: "javascript"
                    }
                }
            },
            schema: {
                model: {
                    id: "id",
                    fields: {
                        Name: { type: "string" },
                        Telephone: { type: "string" },
                        Address: { type: "string" },
                        Suburb: { type: "string" },
                        City: { type: "string" },
                        Province: { type: "string" },
                        Country: { type: "string" },
                        PostalCode: { type: "string" },
                        DeliveryStatus: { type: "string" },
                        Packages: { type: "auto" }
                    }
                }
            }
        });
 
        function showCustomerList() {
            {
                $("#listview-customers").kendoMobileListView({
                    dataSource: dataSource,
                    template: kendo.template($("#customersTemplate").html()),
                    selectable: true,
                    click: function (e) {
                        packages = e.dataItem.Packages;
                        showPackageList();
                        //showButton();
                    }
 
                });
            }
        }
 
        function showPackageList() {
            for (var a = 0; a < packages.length; a++) {
                packageDataSource.add({
                    ID: packages[a].ID,
                    Name: packages[a].Name,
                    Status: packages[a].Status
                });
            }
            $("#listview-customers").kendoMobileListView({
                dataSource: packageDataSource,
                template: kendo.template($("#packagesTemplate").html())
            });
        }
 
        function saveChanges(e) {
            var button = e.button,
                item = packageDataSource.get(button.data("itemId"));
            console.log(item);           
        }
         
    </script>
    <script type="text/x-kendo-template" id="customersTemplate">       
        <h3 class="item-title">${Name}</h3>       
        <p class="item-info">Status: ${DeliveryStatus}</p>       
    </script>
    <script type="text/x-kendo-template" id="packagesTemplate">       
        <h3 class="item-title">${Name}</h3>
        <p class="item-info">Status: ${Status}</p>       
        <select data-role="combobox">
            <option value="Pending">Pending</option>
            <option value="Delivered">Delivered</option>
            <option value="Damaged">Damaged</option>
            <option value="Refused">Refused</option>
        </select>       
        <a data-role="button" data-item-id="#:id#" data-click="saveChanges" class="details-link">Save Changes</a>           
    </script>
</body>
</html>

I would really appreciate it if anyone could help me get this right???
Devon
Top achievements
Rank 1
 asked on 13 Aug 2012
0 answers
75 views
Is it possible to disable or scale back the kinetic scroll on long ListViews without losing the endless scroll functionality? With long lists, this scrolling sometimes seems a bit unnatural. This is particularly noticeable with a "flick" gesture, which seems to react a bit slowly and accelerate/decelerate strangely.

Thanks,
Jason
Jason
Top achievements
Rank 1
 asked on 12 Aug 2012
0 answers
71 views
Fixed...

I have a new problem now but will post as a new question.
Devon
Top achievements
Rank 1
 asked on 07 Aug 2012
0 answers
63 views
hi all,

i was trying to retrieve boolean value from database and display in a list view..
for that i want to design a checkbox,for that checkbox i have to keep a
star image,when i click on star it has to update the value in database and
retrieve list in listview..please have a look at this screen shot for better idea..
please help me out..
Pujita
Top achievements
Rank 1
 asked on 01 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?