当前位置:首页>开发>正文

bootstrap-table怎么ajax获取后台数据并展示 bootstrap模态框怎么传递参数

2023-04-22 17:00:05 互联网 未知 开发

 bootstrap-table怎么ajax获取后台数据并展示 bootstrap模态框怎么传递参数

bootstrap-table怎么ajax获取后台数据并展示

可以先ajax请求,得到返回结果后渲染table
$.get(url, function (result) {
        if (result.code==0000) {
            var data = {total:result.data.totalCount,rows:result.data.dataList}
            $table.bootstrapTable({
                data:data,
                dataType: "json",
                // data:json.data.dataList,
                cache: false, // 不缓存
                // height: getHeight(), // 设置高度,会启用固定表头的特性
                striped: true, // 隔行加亮
                    ...
            })
        }
    }, "json")使用第三方组件就要按照对方的格式返回数据,否则就在js里自己组装成需要的格式。

bootstrap模态框怎么传递参数?

bootstrap参数传递可以用 data-参数名

  如:



  取值的时候用jquery:

  如:$(test).data(user)就可以取到 张三

最新文章