效果如下,点击后左侧Navigator Bar刷新
init显示的代码:
[html] view plain copy
[html] view plain copy
模板函数
[javascript] view plain copy
#= MetricName #
#= HostName #
View
Next
然后是初始化时的载入函数(mobileListViewTemplatesInit)
[javascript] view plain copy
var metricNode = new kendo.data.DataSource({
transport: {
read: {
// the remote service url
url:"http://localhost:3458/EmiteDataService/Nodes",
// JSONP is required for cross-domain AJAX
dataType: "jsonp",
// additional parameters sent to the remote service
data: {
userName:function(){
return 'admin';
},
userDomain:function(){
return 'admin';
},
status:function(){
return $('#metricStatus').val()
}
}
}
},
// describe the result format
schema: {
// the data which the data source will be bound to is in the "results" field
data: ""
},
change: function() { // subscribe to the CHANGE event of the data source
//alert($('#metricId').val());
/*$("#tweets").html(kendo.render(template, this.view()));*/
}
});
function mobileListViewTemplatesInit() {
$("#custom-listview").kendoMobileListView({
dataSource:metricNode,
template: $("#customListViewTemplate").html()
});
}