|
[插件开发]
listview 下拉刷新,上拉加载更多没反应
[复制链接]
本帖最后由 zhangdi 于 2015-6-27 17:53 编辑
apiready = function(){
var listView = api.require('listView');
listView.open({
"x": 0,
"y": 0,
"w": api.frameWidth,
"h": api.frameHeight,
"leftBtn":[
{
"color":"#E76B65",
"selecteColor":"#bc534d",
"title":"左按钮1"
},{
"placeHoldImg":"widget://image/listView/0.png",
"title":"标题9",
"titleLocation":"left",
"titleSize":"13",
"titleColor":"#999999",
"subTitle":"子标题9",
"subLocation":"left",
"subTitleSize":"13",
"subTitleColor":"#999999"
},
{
"placeHoldImg":"widget://image/listView/0.png",
"title":"标题10",
"titleLocation":"left",
"titleSize":"13",
"titleColor":"#999999",
"subTitle":"子标题10",
"subLocation":"left",
"subTitleSize":"13",
"subTitleColor":"#999999"
}],
fixedOn: api.frameName
}, function(ret, err) {
var msg;
if(0 == ret.clickType){
msg = "您点击了第 " + ret.index +" 个单元格";
}
if(1 == ret.clickType){
msg += " 右边第 " + ret.btnIndex + " 个按钮";
}
if(2 == ret.clickType){
msg += " 左边第 " + ret.btnIndex + " 个按钮";
}
api.toast({
msg: msg,
duration: 1000,
location: "top"
});
});
}
/* 设置上拉加载更多. */
listView.setRefreshFooter({
bgColor: "#f5f5f5",
loadingImg : "widget://image/listView/arrow.png",
textColor:textColor,
textDown:textDown,
textUp:textUp,
showTime:showTime
},function(ret,err){
alert("ss");
});
/* 设置下拉刷新. */
listView.setRefreshHeader({
bgColor: "#f5f5f5",
loadingImg : "widget://image/listView/arrow.png",
textColor:textColor,
textDown:textDown,
textUp:textUp,
showTime:showTime
},function(ret,err){
alert("ss");
});
}
|
|