Javascript 如何在刷新时更改引导表属性
我在Github上使用文志新的bootstrap表,就是这个 我想在刷新时将表设置从Javascript 如何在刷新时更改引导表属性,javascript,asp.net,asp.net-mvc,twitter-bootstrap,bootstrap-table,Javascript,Asp.net,Asp.net Mvc,Twitter Bootstrap,Bootstrap Table,我在Github上使用文志新的bootstrap表,就是这个 我想在刷新时将表设置从clickToSelect:true更改为clickToSelect:false 这是我的密码: HTML <html> <button id="refresh"> Refresh </button> <table id="table"> </table> <html> 我希望我能找到解决办法。 谢谢。为什么带有刷新选项的呼
clickToSelect:true
更改为clickToSelect:false
这是我的密码:
HTML
<html>
<button id="refresh"> Refresh
</button>
<table id="table">
</table>
<html>
我希望我能找到解决办法。
谢谢。为什么带有刷新选项的呼叫在刷新按钮处理程序之外?试着这样做:
$(function() {
$('#table').bootstrapTable({
method: 'get',
url: "http://139.199.18.128/Home/GetJSON2",
clickToSelect: true,
columns: [{
checkbox: true
},
{
field: "name",
title: "lon"
},
{
field: "customID",
title: "level"
}
]
});
$("#refresh").click(function() {
$("#table").bootstrapTable("refreshOptions", {
clickToSelect: false,
// Other options you want to override
});
});
});
编辑
如果只想更改clickToSelect字段,请选中此项:
如果要禁用/启用复选框,请选中以下选项:
(可能会更干净,但这是一个开始)在Github上,我尝试了刷新表格,但当我单击它时,仍然无法选择该行@BorisS@Elijah请检查编辑
$(function() {
$('#table').bootstrapTable({
method: 'get',
url: "http://139.199.18.128/Home/GetJSON2",
clickToSelect: true,
columns: [{
checkbox: true
},
{
field: "name",
title: "lon"
},
{
field: "customID",
title: "level"
}
]
});
$("#refresh").click(function() {
$("#table").bootstrapTable("refreshOptions", {
clickToSelect: false,
// Other options you want to override
});
});
});