• Bootstrap table 父子表默认展开


      最近系统用了Bootstrap table ,处于慢慢探索中。

            后来要求table加载默认展开一级数据,如图 ,摸索了一阵子,功能是实现了,一开始

            尝试使用table渲染完成事件 onPostBody :function (index, row, $detail) {
               InitSubTable(index, row, $detail);
            } ,好像没用,报错。 后来发现有个展开方法调用 $("#tb_stationInfo").bootstrapTable('expandAllRows');  但是写在哪? 写在table 刷新之后

       $("#tb_stationInfo").bootstrapTable('refresh'); $("#tb_stationInfo").bootstrapTable('expandAllRows'); 无效。

              想到是不是table 还没渲染完成。后来将展开方法封装成方法,延时调用。function expand (){ $("#tb_stationInfo").bootstrapTable('expandAllRows'); };

           $("#tb_stationInfo").bootstrapTable('refresh'); setTimeout(expand ,1000); 初步达成,但是万一网速很卡,还是会出现问题。

           最后想到将展开方法写到最初onPostBody 事件中,好像是可以的。

           注:这是自己摸索的,不知道有没有官方的使用方法,有的话,望告知,感激不尽。

          

  • 相关阅读:
    Docker Private Registry
    Dockerfile
    docker存储卷
    392. 判断子序列
    1576. 替换所有的问号
    270. 最接近的二叉搜索树值
    292. Nim 游戏
    680. 验证回文字符串 Ⅱ
    876. 链表的中间结点
    543. 二叉树的直径
  • 原文地址:https://www.cnblogs.com/wdnrsjd/p/10318620.html
Copyright © 2020-2023  润新知