zoukankan      html  css  js  c++  java
  • 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 事件中,好像是可以的。

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

          

  • 相关阅读:
    runtime iOS 运行时机制
    iOS 文件操作
    responseCode 状态吗查询
    iOS常用宏定义
    Block里用self造成循环引用
    iOS Block全面分析
    OC与Swift混编
    iOS打包app发给测试人员测试
    Swift UITextField
    sqilite学习
  • 原文地址:https://www.cnblogs.com/wdnrsjd/p/10318620.html
Copyright © 2011-2022 走看看