or
<body ng-app="connectUIApp"><div ng-controller="BrowseContentController"> <button class="k-button" id="applyFilter" ng-click="handleApplyClick(message);">Apply</button> <div id="creatorSelect" ></div></div> <script> var app = angular.module('connectUIApp', ['kendo.directives']); $(document).ready(function() { $("#creatorSelect").kendoPanelBar( { dataSource: [ { text:"Item1", value:"Item1 Value", items:[ { text:"<input type='checkbox' value='type'> Child1</input>", encoded:false }, { text:"<input type='checkbox' value='type'> Child2</input>", encoded:false }, { text:"<input type='checkbox' value='type'> Child3</input>", encoded:false } ]}, { text:"Item2", value:"Item2 Value", items:[ { text:"<input type='checkbox' value='type'> Child1</input>", encoded:false }, { text:"<input type='checkbox' value='type'> Child2</input>", encoded:false } ]} ] }); });
</script>function BrowseContentController($scope) { $scope.handleApplyClick = function() { var panelBar = $("#creatorSelect").kendoPanelBar().data("kendoPanelBar"); var children = panelBar.element.children(); for (var i = 0; i < children.length; i++) { var child = children[i]; var textContent=child.textContent; //var item=child.item(); alert('textContent:'+textContent); } }; }On one view I am calling another view and passing a variable on "click" via a dynamic ListView. The datasource is being populated onShow.
It is working as expected on first usage but if 1) go BACK and choose another option OR 2) complete the first entry and try to create a new one - it blows trying to read the e.dataItem.{somevar}. Ideas why?
app.myService = { onShow: function (e) { .... $("#lvLevel2Options").kendoMobileListView({ dataSource: kendo.data.DataSource.create({data: ds }), template: $("#templateCategoryLevel2").html(), click: app.myService.categoryClicked }); } categoryClicked: function (e) { //It blows HERE but only on second pass var id= e.dataItem.id; .... }Other info: I checked the source of the List and see the data-uid values are changing each time i view the page as I would expect since the datasource is being refreshed onShow (it needs to be because it is dynamic filtered data).