bootstraptable method to hide columns

藏色散人
Release: 2020-11-30 17:00:49
Original
6985 people have browsed it

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>
Copy after login

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
}]
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!