在本文中,您将会了解到关于bootstrap-table的formatter列参数的新资讯,同时我们还将为您解释bootstraptableformatter的相关在本文中,我们将带你探索bootst
在本文中,您将会了解到关于bootstrap-table的formatter列参数的新资讯,同时我们还将为您解释bootstraptable formatter的相关在本文中,我们将带你探索bootstrap-table的formatter列参数的奥秘,分析bootstraptable formatter的特点,并给出一些关于ABP module-zero +AdminLTE+Bootstrap Table+jQuery权限管理系统第十二节--小结,Bootstrap Table之角色管理、bootstarp table引入bootstrap-table-editable.js后报错、bootstrap + bootstrap-table + jquery + bootstrap-paginator、Bootstrap 2或Bootstrap 3 for IE 7 Performance Wise的实用技巧。
本文目录一览:- bootstrap-table的formatter列参数(bootstraptable formatter)
- ABP module-zero +AdminLTE+Bootstrap Table+jQuery权限管理系统第十二节--小结,Bootstrap Table之角色管理
- bootstarp table引入bootstrap-table-editable.js后报错
- bootstrap + bootstrap-table + jquery + bootstrap-paginator
- Bootstrap 2或Bootstrap 3 for IE 7 Performance Wise
bootstrap-table的formatter列参数(bootstraptable formatter)
-
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
-
<%@ include file="../../common/taglibs.jsp"%>
-
<%
-
String path = request.getcontextpath();
-
String basePath = request.getScheme() + "://"
-
+ request.getServerName() + ":" + request.getServerPort()
-
+ path + "/";
-
response.setHeader("x-frame-options", "SAMEORIGIN");// 解决IFrame拒绝的问题
-
%>
-
<!DOCTYPE html>
-
<html>
-
<head>
-
<jsp:include page="../../include/title.jsp"></jsp:include>
-
<style type="text/css">
-
element.style {
-
height: 100%;
-
}
-
.form-horizontal .control-label {
-
padding-top: 0;
-
}
-
</style>
-
</head>
-
<body>
-
<div>
-
<div>
-
<divrole="main">
-
<div>
-
<div>
-
<span>产品名称 :
-
<input size="16" type="text" value="" id="pName" name="pName">
-
</span>
-
</div>
-
<button type="button"id="btn_query">查询</button>
-
</div>
-
<div id="toolbar">
-
<button id="btn_add" type="button"οnclick="add()">
-
<spanaria-hidden="true"></span>新增
-
</button>
-
<!-- <button id="btn_delete" type="button"
-
οnclick="dels()">
-
<spanaria-hidden="true"></span>删除
-
</button> -->
-
</div>
-
<table id="tb_departments"></table>
-
</div>
-
</div>
-
</div>
-
<jsp:include page="../../include/bottom.jsp"></jsp:include>
-
<script type="text/javascript">
-
$(function() {
-
//1.初始化Table
-
var oTable = new TableInit();
-
oTable.Init();
-
});
-
var TableInit = function() {
-
var oTableInit = new Object();
-
//初始化Table
-
oTableInit.Init = function() {
-
$(''#tb_departments'')
-
.bootstrapTable(
-
{
-
url : ''${ctx}/productInfo/listJSON.action'', //请求后台的URL(*)
-
method : ''post'', //请求方式(*)
-
dataType : "json",
-
contentType : "application/x-www-form-urlencoded; charset=UTF-8",
-
toolbar : ''#toolbar'', //工具按钮用哪个容器
-
striped : true, //是否显示行间隔色
-
cache : false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
-
pagination : true, //是否显示分页(*)
-
sortable : false, //是否启用排序
-
sortOrder : "asc", //排序方式
-
queryParams : oTableInit.queryParams,//传递参数(*)
-
sidePagination : "server", //分页方式:client客户端分页,server服务端分页(*)
-
pageNumber : 1, //初始化加载第一页,默认第一页
-
pageSize : 15, //每页的记录行数(*)
-
Pagelist : [ 15, 25, 50], //可供选择的每页的行数(*)
-
search : false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
-
strictSearch : false,
-
showColumns : false, //是否显示所有的列
-
showRefresh : false, //是否显示刷新按钮
-
minimumCountColumns : 2, //最少允许的列数
-
clickToSelect : false, //是否启用点击选中行
-
/* height : 480, *///行高,如果没有设置height属性,表格自动根据记录条数觉得表格高度
-
uniqueId : "id", //每一行的唯一标识,一般为主键列
-
showToggle : false, //是否显示详细视图和列表视图的切换按钮
-
cardView : false, //是否显示详细视图
-
detailView : false, //是否显示父子表
-
columns : [
-
/* 前面 勾选框
-
{
-
field : ''ids'',
-
checkBox : true
-
}, */
-
{
-
field : ''pCode'',
-
title : ''产品编号'',
-
align : ''center''
-
},
-
{
-
field : ''pName'',
-
title : ''产品名称'',
-
align : ''center''
-
},
-
{
-
field : ''pType'',
-
title : ''产品类型'',
-
align : ''center'',
-
formatter:function(value,row,index){
-
var value="";
-
if(row.pType=="1"){
-
value = "自发货";
-
}else if(row.pType=="0"){
-
value = "FBA配送";
-
}else{
-
value = row.pType ;
-
}
-
return value;
-
}
-
},
-
{
-
field : ''pStock'',
-
title : ''最小库存值'',
-
align : ''center''
-
},
-
/* {
-
field : ''pDescription'',
-
title : ''产品描述'',
-
align : ''center''
-
}, */
-
{
-
field : ''createDate'',
-
title : ''创建时间'',
-
align : ''center''
-
},
-
{
-
field : ''id'',
-
title : ''操作'',
-
align : ''center'',
-
formatter : function(value,
-
row, index) {
-
var c = ''<ahref="#" οnclick="info(\''''
-
+ row.id
-
+ ''\'')">查看</a> '';
-
var e = ''<ahref="#" οnclick="input(\''''
-
+ row.id
-
+ ''\'')">编辑</a> '';
-
var d = ''<ahref="#" οnclick="del(\''''
-
+ row.id
-
+ ''\'')">删除</a> '';
-
return c + e + d ;
-
}
-
}, ]
-
});
-
};
-
// 分页查询参数,是以键值对的形式设置的
-
oTableInit.queryParams = function(params) {
-
var list = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
-
limit : params.limit, //每页显示多少条,默认10
-
offset : params.offset, //页码 ,分页数据偏移量
-
pName : $("#pName").val(), //角色查询名称
-
search : params.search
-
};
-
return list;
-
};
-
return oTableInit;
-
};
-
function del(id) {
-
layer.confirm(''确定要删除?'', {
-
title : "提示",
-
}, function() {
-
$.ajax({
-
type : "POST",
-
url : ''${ctx}/productInfo/delete.action?id='' + id,
-
success : function(data) {
-
layer.msg("删除产品成功!", {
-
icon : 1
-
});
-
window.location.href = "${ctx}/productInfo/list.action";
-
}
-
});
-
});
-
};
-
function dels() {
-
var obj = getIdSelections();
-
if (obj.length < 1) {
-
layer.alert(''请选择要删除的选项'', {
-
title : "提示",
-
icon : 7
-
});
-
return;
-
}
-
layer.confirm(''确定要删除?'', {
-
title : "提示"
-
}, function() {
-
$.ajax({
-
type : "POST",
-
url : ''${ctx}/productInfo/deletes.action'',
-
data : "ids=" + obj,
-
success : function(data) {
-
layer.msg("删除会员成功!", {
-
icon : 1
-
});
-
window.location.href = "${ctx}/productInfo/list.action";
-
}
-
});
-
});
-
}
-
function getIdSelections() {
-
return $.map($(''#tb_departments'').bootstrapTable(''getSelections''),
-
function(row) {
-
return row.id;
-
});
-
}
-
function add(id) {
-
layer.open({
-
title : ''新增产品'',
-
type : 2,
-
area : [ ''420px'', ''500px'' ],
-
resize : false, //是否允许拉伸
-
/* 弹出框页面 跳转地址 */
-
content : ''${ctx}/productInfo/input.action'',
-
});
-
}
-
function input(id) {
-
if (typeof (id) == "undefined") {
-
id = "";
-
}
-
layer.open({
-
title : ''产品编辑'',
-
type : 2,
-
area : [ ''420px'', ''500px'' ],
-
resize : false, //是否允许拉伸
-
/* 弹出框页面 跳转地址 */
-
content : ''${ctx}/productInfo/input.action?id='' + id,
-
});
-
}
-
//查看页面
-
function info(id) {
-
layer.open({
-
type : 2,
-
title : ''查看详情'',
-
area : [ ''360px'', ''460px'' ],
-
content : ''${ctx}/productInfo/info.action?id='' + id,
-
});
-
}
-
/*回车 触发 查询按钮 */
-
$(function() {
-
document.onkeydown = function(event) {
-
var e = event || window.event
-
|| arguments.callee.caller.arguments[0];
-
if (e && e.keyCode == 13) {
-
$("#btn_query").click();
-
}
-
};
-
});
-
//搜索按钮触发事件
-
$(function() {
-
$("#btn_query").click(function() {
-
$(''#tb_departments'').bootstrapTable(''refreshOptions'', {
-
pageNumber : 1
-
}); // 很重要的一步,刷新url!
-
});
-
});
-
</script>
-
</body>
-
</html>
直接调
formatter:function(value,row,index)
对后台传入数据 进行操作 对数据重新赋值 返回return到前台
-
{
-
field : ''pType'',
-
title : ''产品类型'',
-
align : ''center'',
-
formatter:function(value,row,index){
-
var value="";
-
if(row.pType=="1"){
-
value = "自发货";
-
}else if(row.pType=="0"){
-
value = "FBA配送";
-
}else{
-
value = row.pType ;
-
}
-
return value;
-
}
-
},
参考地址https://blog.csdn.net/u013943009/article/details/79459029
总结
以上是小编为你收集整理的bootstrap-table的formatter列参数全部内容。
如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。
原文地址:https://blog.csdn.net/weixin_44018338/article/details/100043626
ABP module-zero +AdminLTE+Bootstrap Table+jQuery权限管理系统第十二节--小结,Bootstrap Table之角色管理
总结
以上是小编为你收集整理的ABP module-zero +AdminLTE+Bootstrap Table+jQuery权限管理系统第十二节--小结,Bootstrap Table之角色管理全部内容。
如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。
bootstarp table引入bootstrap-table-editable.js后报错
bootstrap + bootstrap-table + jquery + bootstrap-paginator
http://127.0.0.1:8848/pangBo/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
crossorigin="anonymous"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.12.1/bootstrap-table.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.12.1/bootstrap-table.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.12.1/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="js/bootstrap-paginator.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div>
<formrole="search">
<div>
<div>
<div>
<label>客户编号: </label>
<div>
<input type="text"placeholder="">
</div>
</div>
<div>
<label>客户姓名: </label>
<div>
<input type="text"placeholder="">
</div>
</div>
<div>
<label>手机号码: </label>
<div>
<input type="text"placeholder="">
</div>
</div>
</div>
<div>
<div>
<label>客户编号: </label>
<div>
<input type="text"placeholder="">
</div>
</div>
<div>
<label>客户编号: </label>
<div>
<input type="text"placeholder="">
</div>
</div>
<div>
<label>客户编号: </label>
<div>
<input type="text"placeholder="">
</div>
</div>
</div>
<div>
<button type="submit">查询</button>
</div>
</div>
</form>
</div>
<div>
<divrole="group" aria-label="...">
<button type="button" id="btn-one">可撤单</button>
<button type="button" id="btn-two">已撤单</button>
</div>
</div>
<div id="table-one">
<table id="table"></table>
<div>
<div id="example">
<ul id="pageLimit"></ul>
</div>
</div>
</div>
<div id="table-two">
<table id="table-ta-one"></table>
<div>
<div id="example-two">
<ul id="pageLimit-two"></ul>
</div>
</div>
</div>
<divid="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div>
<div>
<div>
<button type="button"data-dismiss="modal" aria-hidden="true">×</button>
<divid="myModalLabel">请输入登录密码:</div>
</div>
<div>
<div>
<input id="input-text" type="text" value=""placeholder="">
</div>
<button type="button" id="btn-ok">确定撤单</button>
</div>
</div>
</div>
</div>
</body>
</html>
<script type="text/javascript">
function operateFormatter(value, row, index) {
return [
''<button type="button"data-toggle="modal" data-target="#myModal">撤单</button>''
].join('''');
}
window.operateEvents = {
''click .RoleOfdelete'': function(e, value, row, index) {
console.log(''kkk'');
}
};
$(''#table'').bootstrapTable({
url: '''', //请求后台的URL(*)
method: ''GET'', //请求方式(*)
// toolbar: ''#toolbar'', //工具按钮用哪个容器
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: false, //是否显示分页(*)
// pageSize: 10, //每页的记录行数(*)
// pageNumber: 1, //初始化加载第一页,默认第一页,并记录
// sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
uniqueId: "id", //每一行的唯一标识,一般为主键列
columns: [{
field: ''id'',
align: ''center'',
title: ''交易合同号''
},
{
field: ''ida'',
align: ''center'',
title: ''客户编号''
},
{
field: ''idb'',
align: ''center'',
title: ''客户姓名''
},
{
field: ''idc'',
align: ''center'',
title: ''手机号码''
},
{
field: ''idd'',
align: ''center'',
title: ''证件号码''
},
{
field: ''ide'',
align: ''center'',
title: ''产品代码''
},
{
field: ''idf'',
align: ''center'',
title: ''产品名称''
},
{
field: ''idg'',
align: ''center'',
title: ''购买金额''
},
{
field: ''idh'',
align: ''center'',
title: ''交易时间''
},
{
field: ''idi'',
align: ''center'',
title: ''撤单'',
events: operateEvents,
formatter: operateFormatter
},
],
data: [{
id: 1
},
{
id: 1
},
{
id: 1
}
],
onLoadError: function() {
showTips("数据加载失败!");
},
});
$(''#table-ta-one'').bootstrapTable({
url: '''', //请求后台的URL(*)
method: ''GET'', //请求方式(*)
// toolbar: ''#toolbar'', //工具按钮用哪个容器
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: false, //是否显示分页(*)
// pageSize: 10, //每页的记录行数(*)
// pageNumber: 1, //初始化加载第一页,默认第一页,并记录
// sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
uniqueId: "id", //每一行的唯一标识,一般为主键列
columns: [{
field: ''id'',
align: ''center'',
title: ''交易合同号''
},
{
field: ''ida'',
align: ''center'',
title: ''客户编号''
},
{
field: ''idb'',
align: ''center'',
title: ''客户姓名''
},
{
field: ''idc'',
align: ''center'',
title: ''手机号码''
},
{
field: ''idd'',
align: ''center'',
title: ''证件号码''
},
{
field: ''ide'',
align: ''center'',
title: ''产品代码''
},
{
field: ''idf'',
align: ''center'',
title: ''产品名称''
},
{
field: ''idg'',
align: ''center'',
title: ''购买金额''
},
{
field: ''idh'',
align: ''center'',
title: ''交易时间''
}
],
data: [{
id: 1
},
{
id: 1
},
{
id: 1
}
],
onLoadError: function() {
showTips("数据加载失败!");
},
});
$(''#btn-one'').click(function() {
console.log(''kk'');
$(''#table-one'').show();
$(''#table-two'').hide();
$(''#btn-one'').css({
''background-color'': ''#e6e6e6''
})
})
$(''#btn-two'').click(function() {
console.log(''kkk'');
$(''#table-two'').show();
$(''#table-one'').hide();
$(''#btn-one'').css({
''background-color'': ''#FFF''
})
})
$(''#pageLimit'').bootstrapPaginator({
currentPage: 1, //当前的请求页面。
totalPages: 100, //一共多少页。
size: "normal", //应该是页眉的大小。
bootstrapMajorVersion: 3, //bootstrap的版本要求。
alignment: "right",
numberOfPages: 5, //一页列出多少数据。
itemTexts: function(type, page, current) { //如下的代码是将页眉显示的中文显示我们自定义的中文。
switch (type) {
case "first":
return "首页";
case "prev":
return "上一页";
case "next":
return "下一页";
case "last":
return "末页";
case "page":
return page;
}
}
});
$(''#pageLimit-two'').bootstrapPaginator({
currentPage: 1, //当前的请求页面。
totalPages: 100, //一共多少页。
size: "normal", //应该是页眉的大小。
bootstrapMajorVersion: 3, //bootstrap的版本要求。
alignment: "right",
numberOfPages: 5, //一页列出多少数据。
itemTexts: function(type, page, current) { //如下的代码是将页眉显示的中文显示我们自定义的中文。
switch (type) {
case "first":
return "首页";
case "prev":
return "上一页";
case "next":
return "下一页";
case "last":
return "末页";
case "page":
return page;
}
}
});
$(''#btn-ok'').click(function() {
var inputContent = $(''#input-text'').val();
if (inputContent == '''') {
alert(''密码不能为空 !'');
}
console.log(inputContent);
})
</script>
Bootstrap 2或Bootstrap 3 for IE 7 Performance Wise
Bootstrap 3刚刚发布,无数改进.一个潜在的交易破坏者是降低IE 7的兼容性.对于满足企业用户的网站来说,这不幸是不实际的,因为在一个特定的用例中大概是10%的市场.
所以支持IE7是一个必须的,一个人会认为只是选择坚持使用Bootstrap 2.但是,使用这个https://github.com/coliff/bootstrap-ie7可以轻松添加IE7支持,同时保持Bootstrap 3的所有好处.
一个问题是您必须使用Boxsizing.htc polyfill for IE 7用户(https://github.com/Schepp/box-sizing-polyfill)
所以我的问题是更好地坚持使用Bootstrap 2或者切换到Bootstrap 3.0 with Boxsizing.htc? B3的.htc对于10%的IE7用户而言比B2更慢,但如果几乎不明显(特别是如果服务器是缓存),这对90%的其余部分的好处是值得的.
如果知道的话,我猜测我可以测试的下一件事是使用.htc演示站点安装默认的B2和B3,并比较IE7的速度.
PS如果有一个更好的polyfill添加盒子化IE7比上面列出的性能明智让我知道.
解决方法
它可以通过返回到没有填充的流体柱的Bootstrap 2型网格系统和从第二列开始的左边距来起作用.在IE7与Bootstrap 3,我的网站看起来完美.
我已经测试了(它的工作原理)与Bootstrap的大部分组件.它还包括针对IE布局错误和其他奇怪行为的修复.
我刚刚把它放在Github上.希望有帮助:
https://github.com/LPology/Bootstrap-IE7Fix
我们今天的关于bootstrap-table的formatter列参数和bootstraptable formatter的分享就到这里,谢谢您的阅读,如果想了解更多关于ABP module-zero +AdminLTE+Bootstrap Table+jQuery权限管理系统第十二节--小结,Bootstrap Table之角色管理、bootstarp table引入bootstrap-table-editable.js后报错、bootstrap + bootstrap-table + jquery + bootstrap-paginator、Bootstrap 2或Bootstrap 3 for IE 7 Performance Wise的相关信息,可以在本站进行搜索。
本文标签: