Bootstrap Table 查询实现


本文摘自PHP中文网,作者angryTom,侵删。

一个功能齐全且用户体验良好的表格,查询功能都是并不可少的,因为表格的数据量有时可能相当庞大,这时候如果需要查找一个特定的数据,那将是十分庞大的工作量。下面我们就为大家介绍一下如何使用bootstrap table插件来实现查询功能。

推荐教程:Bootstrap视频教程

实现查询思路:

1.定义一个局左的Toolbar包含 新建、保存和新建的按钮

2.定义一个局右的QueryForm 包含查询条件 和 查询清除按钮

3.定义一个Table

实现效果如下:

bootstrap51.png

代码如下

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

<div class="container-fluid">

 

    <div>

        <div id="toolbar-btn" class="btn-group pull-left" style="padding-bottom:10px;">

            <button id="btn_add" οnclick="createFunction()" type="button" class="btn btn-primary btn-space">

                <span class="fa fa-plus-square" aria-hidden="true" class="btn-icon-space"></span>

                <@spring.message "fnd.new"/>

            </button>

            <button id="btn_save" οnclick="saveFunction()" type="button" class="btn btn-success btn-space">

                <span class="fa fa-save" aria-hidden="true" class="btn-icon-space"></span>

                <@spring.message "fnd.save"/>

            </button>

            <button id="btn_delete" οnclick="deleteFunction()" type="button" class="btn btn-danger btn-space">

                <span class="fa fa-trash-o" aria-hidden="true" class="btn-icon-space"></span>

                <@spring.message "fnd.delete"/>

            </button>

        </div>

 

        <div class="pull-right" id="query-form" style="padding-bottom:10px;">

            <input name="lookupType" placeholder='<@spring.message "fnd.lookup_type"/>' type="text"

                   style="float:left;width:150px;margin-right:5px;" v-model="lookupType"

                   class="form-control">

            <div style="float:left;margin-right:5px;">

                <input name="description" placeholder='<@spring.message "fnd.description"/>' type="text"

                       style="float:left;width:150px;margin-right:5px;" v-model="description"

                       class="form-control">

            </div>

 

            <div class="btn-group">

                <button id="btn_search" οnclick="customSearch()" type="button" class="btn btn-primary btn-space">

                    <span class="fa fa-search" aria-hidden="true" class="btn-icon-space"></span>

                    <@spring.message "fnd.query"/>

                </button>

                <button id="btn_reset" οnclick="resetSearch()" type="button" class="btn btn-default btn-space">

                    <span class="fa fa-eraser" aria-hidden="true" class="btn-icon-space"></span>

                    <@spring.message "fnd.reset"/>

                </button>

            </div>

 

        </div>

    </div>

 

 

    <table id="table" class="table  table-condensed table-striped"></table>

 

</div>

查询函数实现

阅读剩余部分

相关阅读 >>

浅谈vue项目中使用npm安装bootstrap和jquery

前端javascript写excel的代码示例

bootstrap有哪些内容

bootstrap为什么是12栅格

bootstrap与html5的区别是什么

bootstrap tab 没有反应怎么办

bootstrap如何给div设置边框颜色

bootstrap框架优点是什么

bootstrap基本结构有哪些

react和bootstrap区别

更多相关阅读请进入《bootstrap》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...