Hi, I am currently developing an app that has two listviews, one on the mainview, and another on the secondary view, both which are using remote data call using jsonp. the items generated on the first listviews are links to the next listview, I know it sounds confusing, basically im using jquery to grab an attribute from an element on the main listview and that is used for the URL of the new listview, similar to the problem in this forum: http://www.kendoui.com/forums/mobile/listview/mobile-listview-is-not-refreshing-on-button-click.aspx
here is a copy of my code, hope you can understand and help me out here
Im having trouble loading the second listview with a dynamic URL
here is a copy of my code, hope you can understand and help me out here
Im having trouble loading the second listview with a dynamic URL
<!--Main view-->
<
div
data-role
=
"view"
data-init
=
"mobileListViewDataBindInitFlat"
data-title
=
"ClickView 24/7 Alerts"
id
=
"mainView"
>
<
ul
data-role
=
"listview"
data-style
=
"inset"
data-type
=
"group"
id
=
"result"
></
ul
>
</
div
>
<!--Alerts Display view -->
<
div
data-role
=
"view"
id
=
"displayPage"
data-title
=
"ClickView 24/7 Alerts"
data-init
=
"mobileListViewint"
>
<
ul
data-role
=
"listview"
id
=
"datashow"
>
</
ul
>
</
div
>
<!--main layout-->
<
div
id
=
"layout"
data-role
=
"layout"
data-id
=
"main-layout"
>
<
div
data-role
=
"header"
>
<
div
data-role
=
"navbar"
>
<
span
data-role
=
"view-title"
></
span
>
</
div
>
</
div
>
<
div
data-role
=
"footer"
>
<
div
data-role
=
"tabstrip"
>
<
a
href
=
"#mainView"
data-icon
=
"home"
>Home</
a
>
<
a
href
=
"#alertPage"
data-icon
=
"favorites"
>Alerts</
a
>
</
div
>
</
div
>
</
div
>
<!-- Main Listview Template-->
<
script
type
=
"text/x-kendo-template"
id
=
"showtemp"
>
<
a
class
=
"show"
href
=
"\#displayPage"
data-show
=
"${ProgramId}"
>
<
span
class
=
"date"
>${Start}</
span
>
<
h2
>${Title}</
h2
>
<
h3
class
=
"chan"
>${Channel}</
h3
>
<
p
class
=
"descript"
>${Description}</
p
>
</
a
>
</
script
>
<!-- Alerts Listview Template-->
<
script
type
=
"text/x-kendo-template"
id
=
"datatemp"
>
<
h3
class
=
"keyword"
>Keyword: #: Keyword#</
h3
>
<
a
class
=
"actionbutton"
data-role
=
"detailbutton"
data-style
=
"contactadd"
></
a
>
<
p
class
=
"subtime"
>#: SubTime#</
p
>
<
p
class
=
"subtext"
>#: SubText#</
p
>
</
script
>
<
script
>
window.app = new kendo.mobile.Application(document.body,{transition: "slide", layout: "main-layout"});
//Main ListView initialiser
var showDataSource = new kendo.data.DataSource({
transport: {
read: {
url: "http://localhost:3146/api/shows/wilan.bigay@clickview.com.au",
dataType: "jsonp",
contentType: "application/json; charset=utf-8",
data: {
q: "javascript"
}
}
}
});
function mobileListViewDataBindInitFlat() {
$("#result").kendoMobileListView({
dataSource: showDataSource,
template: $("#showtemp").text(),
})
}
$('.show').live('click',function(){
var progID = $(this).attr('data-show');
var dataURL = 'http://localhost:3146/api/shows/wilan.bigay@clickview.com.au/data/' + progID
});
//Alerts ListView
var dataDataSource = new kendo.data.DataSource({
transport: {
read: {
url: dataURL , //"http://localhost:3146/api/shows/wilan.bigay@clickview.com.au/data/0000000",<- how it should look like taking the 'data-show' attribute at the end of the URL
dataType: "jsonp",
contentType: "application/json; charset=utf-8",
data: {
q: "javascript"
}
}
}
});
function mobileListViewint() {
$("#datashow").kendoMobileListView({
dataSource: dataDataSource,
click: function(e) {
//dataURL = e.dataItem.data-show;
console.log(e.dataItem.title);
},
template: $("#datatemp").text(),
})
}
</
script
>