Home  >  Article  >  Web Front-end  >  bootstraptable method to hide columns

bootstraptable method to hide columns

藏色散人
藏色散人Original
2020-11-20 10:31:337027browse

How to hide columns in bootstraptable: 1. Hide through "bootstrapTable('hideColumn', 'GoodsId');"; 2. Hide through the attribute "visible: false".

bootstraptable method to hide columns

# Recommended: "

bootstrap video tutorial

The operating environment of this tutorial: Windows 10 system, bootstrap version 3.0. This method is suitable for all brands of computers.

How to hide columns in bootstraptable:

hidden: true in bootstrapTable doesn’t work! The code on the Internet is this $(table).bootstrapTable('showColumn', 'Field to be hidden')

First way

<script type="text/javascript">
 
        $(function () {
            LoadingDataListOrderRealItems();
            $(&#39;#tableOrderRealItems&#39;).bootstrapTable(&#39;showColumn&#39;, &#39;ShopName&#39;);
            $(&#39;#tableOrderRealItems&#39;).bootstrapTable(&#39;hideColumn&#39;, &#39;GoodsId&#39;);
        }); 
 
    </script>

Second way:

Hide: visible: false,

Show: visible: true,

The visible attribute does not have true or false, it is visible, invisible and gone.

visible: visible;
invisible: invisible, but takes up space;
gone: invisible, does not take up space, the control disappears from the layout.

columns:[
	{
	 	title: &#39;id&#39;,
		field: &#39;id&#39;,
		 align: &#39;center&#39;,
		valign: &#39;middle&#39;,
		 width: &#39;7%&#39;,
		 visible: false
}]

The above is the detailed content of bootstraptable method to hide columns. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn