bootstrap 基本用法
获取页面数据:
$(function(){
$("#bootstrapTable").bootstrapTable({
url: "{:\\think\\Url::build('distribution/index')}",
idField: 'id',//主键
search: true,//显示搜索框
cache: false, //是否使用缓存
sortOrder: 'desc',//
striped: true, //是否显示行间隔色
detailView: true, //开启详细视图功能
pagination: true,
sidePagination: 'server',
pageNumber: 1,
pageSize: 15,
pageList: '[15, 30, 100]',//分页
showRefresh: true,
showToggle: false,
showColumns: true,
iconSize: "outline",
toolbar: "#bootstrapTableToolbar",
onExpandRow: function (index, row, $detail) {
detailTable(row, $detail);//调用detailTable()方法
}
});ajax请求:
$("#is_auto").change(function() {
var is_auto = $(this).is(':checked') ? 1 : 0;//is(checked)判断是否被选中
$.ajax({
url: "{:\\think\\Url::build('distribution/is_auto')}",
type: "post",
data: {status: is_auto},
dataType: "json",
success: function (data) {
if ( === 1) {
(, {icon: 1, shift: 6});//弹出警示框并自动关闭
bootstrap 基本用法 来自淘豆网m.daumloan.com转载请标明出处.