Bootstrap Table默認隱藏列

常常因爲表格字段比較長,須要默認隱藏不是特別重要的列,只須要2步便可完成bootstrap

一、首先在thead裏設置data-field 屬性 ide

<thead>
      <th data-sortable="true" data-field="dataTypeId">客戶名稱table

      <th data-sortable="true" data-field="datayibiao">客戶名稱方法

</thead>sort

   二、調用hideColumn方法tab

    $('#tableTest3').bootstrapTable('hideColumn',"dataTypeId"); //tableTest3爲table的ID
    $('#tableTest3').bootstrapTable('hideColumn',"datayibiao") ;block

相關文章
相關標籤/搜索