帖子
帖子
用户
博客
课程
显示全部楼层
12
帖子
0
勋章
183
Y币

[插件开发] listview 下拉刷新,上拉加载更多没反应

[复制链接]
发表于 2015-6-18 22:43:47
本帖最后由 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");
     });
}


7
帖子
0
勋章
240
Y币
为什么   fixedOn: api.frameName 会报错提示:

Uncaught SyntaxError: Unexpected token ILLEGAL
5
帖子
0
勋章
1万+
Y币
pendant 发表于 2015-7-1 01:57
为什么   fixedOn: api.frameName 会报错提示:

Uncaught SyntaxError: Unexpected token ILLEGAL ...

token 非法,不是  fixedOn: api.frameName的问题,你检查下token
7
帖子
0
勋章
240
Y币
技术支持-M 发表于 2015-7-1 09:36
token 非法,不是  fixedOn: api.frameName的问题,你检查下token

token指的的是什么?我在xml中正确填写了widget id="xxxxxx"
5
帖子
0
勋章
1万+
Y币
pendant 发表于 2015-7-1 09:50
token指的的是什么?我在xml中正确填写了widget id="xxxxxx"

xml自动有ID,不需要配置
7
帖子
0
勋章
240
Y币
技术支持-M 发表于 2015-7-1 10:05
xml自动有ID,不需要配置

那请版主帮我看看我发的帖子问题,怎么解决好吗?
您需要登录后才可以回帖 登录

本版积分规则