<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ include file="/include.jsp"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//Dth HTML 4.01 TranstablePatentBasicItemional//EN" "http://www.w3.org/TR/html4/loose.dth">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<jsp:include page="includePage.jsp"/>
<script type="text/javascript">
$(function () {
/* jquery ui datepicker日期插件 */
$(".datepicker").datepicker({dateFormat: "yy-mm-dd"});
/* 查询 */
$("#searchBtn").click(function(){
$('#eventsTable').bootstrapTable('refresh',
{query: {'codeAbb': $('#codeAbb').val(),
'codeCn': $('#codeCn').val(),
'codeEn': $('#codeEn').val(),
'fromTime': $('#fromTime').val(),
'toTime': $('#toTime').val()}});
});
//1.初始化Table
var oTable = new TableInit();
oTable.Init();
//2.初始化Button的点击事件
var oButtonInit = new ButtonInit();
oButtonInit.Init();
$("#btn_add").click(function(){
location.href="<%=path%>/admin/login/toAdd.htm";
});
$("#btn_edit").click(function(){
var selects = $('#eventsTable').bootstrapTable('getSelections');
if(selects.length == 0){
alert("请选择一条要修改!");
}else{
location.href = "<%=path%>/admin/login/toUpdate.htm?id="+selects[0].id;
}
});
$("#btn_delete").click(function(){
var selects = $('#eventsTable').bootstrapTable('getSelections');
if(selects.length == 0){
alert("请选择一条要删除的对象!");
}else{
if(window.confirm("确定要删除此用户?")){
$.get("<%=path%>/admin/login/delete.htm?id="+selects[0].id,
function(data){
alert(data.result);
location.href = "<%=path%>/admin/login/toList.htm";
}
);
}else{
return false;
}
}
});
});
var TableInit = function () {
var oTableInit = new Object();
//初始化Table
oTableInit.Init = function () {
$('#eventsTable').bootstrapTable({
url : '<%=path%>/admin/login/findByPage.json',
method: 'post',
toolbar: '#toolbar',
striped: true,
cache: false,
pagination: true,
sortable: false,
sortOrder: "asc",
/*queryParams: prototype.onPageChange, */
sidePagination: "server",
pageNumber:1,
pageSize: 10,
pageList: [10, 20, 50, 100],
/* search: true,
searchOnEnterKey : false,
strictSearch: false,
trimOnSearch : true,*/
showColumns: true,
showRefresh: true,
minimumCountColumns: 2,
clickToSelect: true, //点击选中
singleSelect : true, //单选
height: 550, //表格高度
uniqueId: "id", //唯一标识
showToggle:false, //是否显示cardView按钮
cardView: false,
detailView: false,
queryParams: function queryParams(params) { //设置查询参数
var param = {
limit : params.limit,
offset: params.offset,
'codeAbb': $('#codeAbb').val(),
'codeCn': $('#codeCn').val(),
'codeEn': $('#codeEn').val(),
'fromTime': $('#fromTime').val(),
'toTime': $('#toTime').val()
};
return param;
},
columns: [{
checkbox: true,
width:'3%'
}, {
field: 'id',
title: '编号',
width : '5%'
}, {
field: 'companyId',
title: '公司编号',
width : '5%'
}, {
field: 'codeId',
title: '产品编号',
width : '5%'
}, {
field: 'parentId',
title: '父编号',
width : '4%'
}, {
field: 'isParent',
title: '是否有子类',
width : '5%',
formatter:function(value,row,index){
if(value == 1){
return '是';
}else {
return '否';
}
}
}, {
field: 'codeAbb',
title: '简称',
width : '8%'
}, {
field: 'codeCn',
title: '中文名称' ,
width : '5%'
}, {
field: 'codeEn',
title: '英文名称',
width : '5%'
}, {
field: 'comments',
title: '备注',
align : 'center',
width : '14%'
}, {
field: 'state',
title: '状态',
width : '5%'
}, {
field: 'isShare',
title: '是否共享',
width : '5%',
formatter:function(value,row,index){
if(value == 'Y'){
return '是';
}else {
return '否';
}
}
}, {
field: 'creator',
title: '创建者',
width : '5%'
}, {
field: 'createtime',
title: '创建时间',
width : '10%'
}, {
field: 'modifor',
title: '修改者',
width : '5%'
}, {
field: 'modifytime',
title: '修改时间',
width : '10%'
},]
});
};
return oTableInit;
};
/* $('#eventsTable').bootstrapTable.prototype.onPageChange = function (number, size) {
var temp = {
'codeAbb': $('#codeAbb').val(),
'codeCn': $('#codeCn').val(),
'codeEn': $('#codeEn').val(),
'fromTime': $('#fromTime').val(),
'toTime': $('#toTime').val()
};
return temp;
}; */
var ButtonInit = function () {
var oInit = new Object();
oInit.Init = function () {
//初始化页面上面的按钮事件
};
return oInit;
};
</script>
<title>显示列表</title>
</head>
<body>
<div id="searchbar" >
<form class="bs-example bs-example-form" id="searchForm">
<div class="input-group">
<span class="input-group-addon">按简称:</span>
<input type="text" id="codeAbb" class="form-control"/>
<span class="input-group-addon">中文名称:</span>
<input type="text" id="codeCn" class="form-control"/>
<span class="input-group-addon">英文名称:</span>
<input type="text" id="codeEn" class="form-control"/>
<span class="input-group-addon">创建日期:从</span>
<input type="text" id="fromTime" class="form-control datepicker" />
<span class="input-group-addon">到</span>
<input type="text" id="toTime" class="form-control datepicker"/>
<span class="input-group-addon"><button type="button" id="searchBtn">查询</button></span>
</div>
</form>
</div>
<div id="toolbar" class="btn-group">
<button id="btn_add" type="button" class="btn btn-default" >
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
</button>
<button id="btn_edit" type="button" class="btn btn-default">
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>修改
</button>
<button id="btn_delete" type="button" class="btn btn-default">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>删除
</button>
</div>
<table id="eventsTable" >
</table>
</body>
</html>
- 浏览: 8053 次
- 性别:
- 来自: 厦门
相关推荐
知识点bootstrapTable 刷新和查询配置 2.提升js代码性能 1.减少全局变量声明 2.缓存dom节点查找结果 3.局部变量缓存全局变量 /** * @param col bootstrapTable列表生成配置对象 */ var searchValue ={};//查询...
Bootstrap table还有一个很多强大的功能,下面就通过本文给大家分享基于Bootstrap table组件实现多层表头的实例代码,需要的朋友参考下吧
修改bootstrap table设置列宽问题,增加插件和bootstrap table组合可随意拖动表格的列宽
bootstrap table各个属性值的详细说明,中文翻译版本。
bootstrapTable组件的使用示例,里面包含父子表、treegrid以及结合knockoutjs的使用示例。博客园博主本人资源,有问题可以联系。
BootStrap Table两个Table数据之间行数据拖拽。
本人因为项目开发的需要,需要用到一个表格插件。于是看上了Bootstrap Table,官网只是给了一个例子,于是我把官网的代码给爬下来。在基础上进行自己的修改。如果有兴趣可以下载来看看,代码个官网的是一模一样的。
在之前做过的一个web项目中,前端表格是基于jQuery和Bootstrap Table实现的,要求能利用...Bootstrap Table可拖动列,需要用到它的Resizable扩展插件需要引入 bootstrap-table扩展插件 bootstrap-table-resizable.js
bootstrap table分页例子 bootstrap table实现了2种分页方式。
通过修改bootstrap table js 定制出自己的分页栏,样式仿照jqGrid样式,支持输入页码跳转
主要介绍了BootStrap Fileinput插件和Bootstrap table表格插件相结合实现文件上传、预览、提交的导入Excel数据操作步骤,需要的朋友可以参考下
使用 maven 创建的 基于 bootstrap table 的示例代码 使用 ajax 后台分页获取查询数据
Bootstrap Table 跨页选择,用于后台分页的表格,保存非当前页的勾选行数据,翻回去又可以自动勾选,又可通过函数获取勾选的全部数据。
bootstraptable父子表,子表找不到bootstraptable初始化方法的解决方案
Bootstraptable建立父子表 detailView: true 的折叠使用
Bootstrap Table是基于Bootstrap的轻量级表格插件,只需要简单的配置就可以实现强大的支持固定表头、单复选、排序、分页、搜索以及自定义表头等功能
Bootstrap+BootstrapTable+x-editable(css和js)整合包 内含 jq,js Bootstrap+BootstrapTable+x-editable内部的js 和css文件,一个整合包满足你的所有需求
实现了bootstrapTable 的列宽可鼠标拖动,方便查看列宽显示不完全的内容,前台js
bootstrap-table冻结列例子
Bootstrap Table API 中文版(完整翻译文档) 基于 Bootstrap 的 jQuery 表格插件,通过简单的设置,就可以拥有强大的单选、多选、排序、分页,以及编辑、导出、过滤(扩展)等等的功能。