BootstrapTable自定义ajax方法

bootstrapTable可以自定义ajax方法,通过ajax请求获得数据返回展示在bootstrapTable表格中,这种方式我自认为比较简单常用。本篇还加了简单增删改操作,获得表格选中的数据,以及按钮可用与否。这些比较常用。

BootstrapTable自定义ajax方法_第1张图片

BootstrapTable自定义ajax方法_第2张图片

index.html



	
		
		bootstrap-table-demo
		
		
		
		
		
		
		
	
	
	
	

bootstrap-table


ID Name Price

data4.json

{
"code": 0,
"total": 1314,
"message": "success",
"array" :
[
{
"id": 0,
"name": "Item 0",
"price": "$1"
},
{
"id": 1,
"name": "Item 1",
"price": "$1"
},
{
"id": 2,
"name": "Item 2",
"price": "$2"
},
{
"id": 3,
"name": "Item 3",
"price": "$3"
},
{
"id": 4,
"name": "Item 4",
"price": "$1"
},
{
"id": 5,
"name": "Item 5",
"price": "$1"
},
{
"id": 6,
"name": "Item 6",
"price": "$1"
},
{
"id": 7,
"name": "Item 7",
"price": "$1"
},
{
"id": 8,
"name": "Item 8",
"price": "$1"
},
{
"id": 9,
"name": "Item 9",
"price": "$1"
}
]
}

edit.html



	
		
		编辑
		
		
		
		
		
		
		
	
	
	
	

 

 

你可能感兴趣的:(BootstrapTable自定义ajax方法)