Skip to content

Commit

Permalink
Deploying to gh-pages from @ d24c460 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
wenzhixin committed Jul 27, 2024
1 parent f179a0a commit 1db38a3
Show file tree
Hide file tree
Showing 28 changed files with 141 additions and 51 deletions.
4 changes: 2 additions & 2 deletions assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ function loadUrl(url_) {
if (window._config.themes.indexOf(window._config.theme) > -1) {
template += '-' + window._config.theme
}
var url = template + '.html?v=914&url=' + url_
var url = template + '.html?v=924&url=' + url_
if (window._config.isDebug) {
url = template + '.html?t=' + (+new Date()) + '&url=' + url_
}
if (window._config.isViewSource) {
url = template + '.html?v=914&view-source&url=' + url_ + '#view-source'
url = template + '.html?v=924&view-source&url=' + url_ + '#view-source'
}
$('iframe').attr('src', url)
}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/template.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
window._config = {
isDebug: location.hash.slice(1) === 'is-debug' ||
['localhost', '127.0.0.1', 'dev.bootstrap-table.com'].indexOf(location.hostname) > -1,
cdnUrl: 'https://cdn.jsdelivr.net/npm/[email protected].1/dist/',
cdnUrl: 'https://cdn.jsdelivr.net/npm/[email protected].2/dist/',
localUrl: '../bootstrap-table/src/',
testUrl: '/src/'
}
Expand Down
2 changes: 1 addition & 1 deletion extensions/addrbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
if (theme) {
template = 'template-' + theme + '.html'
}
$('#launch').attr('href', template + '?v=914&url=extensions/addrbar-page.html')
$('#launch').attr('href', template + '?v=924&url=extensions/addrbar-page.html')
}
</script>
27 changes: 24 additions & 3 deletions extensions/export.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,30 @@
data-toolbar="#toolbar"
data-show-toggle="true"
data-show-columns="true"
data-show-footer="true"
data-url="https://examples.wenzhixin.net.cn/examples/bootstrap_table/data">
</table>

<script>
var $table = $('#table')

function idFormatter() {
return 'Total'
}

function nameFormatter(data) {
return data.length
}

function priceFormatter(data) {
var field = this.field
return '$' + data.map(function (row) {
return +row[field].substring(1)
}).reduce(function (sum, i) {
return sum + i
}, 0)
}

function mounted() {
$('#toolbar').find('select').change(function () {
$table.bootstrapTable('destroy').bootstrapTable({
Expand All @@ -55,15 +73,18 @@
},
{
field: 'id',
title: 'ID'
title: 'ID',
footerFormatter: idFormatter
},
{
field: 'name',
title: 'Item Name'
title: 'Item Name',
footerFormatter: nameFormatter
},
{
field: 'price',
title: 'Item Price'
title: 'Item Price',
footerFormatter: priceFormatter
}
]
})
Expand Down
2 changes: 1 addition & 1 deletion for-test-bootstrap3.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script>
<script src="assets/js/template.js?v=914"></script>
<script src="assets/js/template.js?v=924"></script>
</head>
<body>
<div id="example"></div>
Expand Down
2 changes: 1 addition & 1 deletion for-test-bootstrap4.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/template.js?v=914"></script>
<script src="assets/js/template.js?v=924"></script>
</head>
<body>
<div id="example"></div>
Expand Down
2 changes: 1 addition & 1 deletion for-test-bulma.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css">

<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
<script src="assets/js/template.js?v=914"></script>
<script src="assets/js/template.js?v=924"></script>
</head>
<body>
<div id="example"></div>
Expand Down
2 changes: 1 addition & 1 deletion for-test-foundation.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/foundation.min.js"></script>
<script src="assets/js/template.js?v=914"></script>
<script src="assets/js/template.js?v=924"></script>
</head>
<body>
<div id="example"></div>
Expand Down
2 changes: 1 addition & 1 deletion for-test-materialize.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/materialize.min.js"></script>
<script src="assets/js/template.js?v=914"></script>
<script src="assets/js/template.js?v=924"></script>
</head>
<body>
<div id="example"></div>
Expand Down
2 changes: 1 addition & 1 deletion for-test-semantic.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.js"></script>
<script src="assets/js/template.js?v=914"></script>
<script src="assets/js/template.js?v=924"></script>
</head>
<body>
<div id="example"></div>
Expand Down
2 changes: 1 addition & 1 deletion for-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/template.js?v=914"></script>
<script src="assets/js/template.js?v=924"></script>
</head>
<body>
<div id="example"></div>
Expand Down
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/themes/algolia-min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/hover.min.css">
<link rel="stylesheet" href="assets/css/docs.min.css">
<link rel="stylesheet" href="assets/css/index.css?v=914">
<link rel="stylesheet" href="assets/css/index.css?v=924">
<!-- Favicons -->
<link rel="apple-touch-icon" href="favicon.png">
<link rel="icon" href="favicon.png">
Expand Down Expand Up @@ -161,6 +161,7 @@
<li><a href="#options/basic-columns.html">Basic Columns</a></li>
<li><a href="#options/buttons.html">Buttons Custom</a></li>
<li><a href="#options/buttons-align.html">Buttons Align</a></li>
<li><a href="#options/buttons-attribute-title.html">Buttons Attribute Title</a></li>
<li data-show="bootstrap3,bootstrap4,"><a href="#options/buttons-class.html">Buttons Class</a></li>
<li><a href="#options/buttons-order.html">Buttons Order</a></li>
<li data-show="bootstrap3,bootstrap4,"><a href="#options/buttons-prefix.html">Buttons Prefix</a></li>
Expand Down Expand Up @@ -596,5 +597,5 @@
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/algoliasearchLite.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/instantsearch.production.min.js"></script>
<script src="assets/js/docs.min.js"></script>
<script src="assets/js/index.js?v=914"></script>
<script src="assets/js/index.js?v=924"></script>
</body></html>
13 changes: 9 additions & 4 deletions methods/insert-row.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
<button id="button" class="btn btn-secondary">insertRow</button>
</div>
<table id="table"
data-toggle="table"
data-toolbar="#toolbar"
data-height="428"
data-url="json/data1.json">
data-toggle="table"
data-toolbar="#toolbar"
data-height="428"
data-url="json/data1.json">
<thead>
<tr>
<th data-field="state" data-checkbox="true"></th>
<th data-field="id">ID</th>
<th data-field="name">Item Name</th>
<th data-field="price">Item Price</th>
Expand All @@ -40,5 +41,9 @@
}
})
})

$table.on('check.bs.table', (event, row) => {
console.log(JSON.stringify(row))
})
}
</script>
36 changes: 28 additions & 8 deletions methods/update-cell.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,27 @@
</script>

<div id="toolbar">
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" checked id="reinit">
<label class="form-check-label" for="flexCheckDefault">
reinit
</label>
</div>
<button id="button" class="btn btn-secondary">updateCell</button>
</div>
<table
id="table"
data-toggle="table"
data-toolbar="#toolbar"
data-height="428"
data-search="true"
data-url="json/data1.json">
<thead>
<tr>
<th data-checkbox="true" data-field="state"></th>
<th data-field="id">ID</th>
<th data-field="name" data-width="300">Item Name</th>
<th data-field="price">Item Price</th>
<th data-field="id" data-sortable="true">ID</th>
<th data-field="name" data-sortable="true" data-width="300">Item Name</th>
<th data-field="price" data-sortable="true">Item Price</th>
</tr>
</thead>
</table>
Expand All @@ -32,15 +39,28 @@

function mounted() {
$button.click(function () {
let i = 0
setInterval(() => {
const checked = $('#reinit').prop('checked')

if (!checked) {
let i = 0
const timeout = setInterval(() => {
$table.bootstrapTable('updateCell', {
index: 1,
field: 'name',
value: `Updated Name ${i++}`,
reinit: false
})
if (i > 10) {
clearInterval(timeout)
}
}, 100)
} else {
$table.bootstrapTable('updateCell', {
index: 1,
field: 'name',
value: `Updated Name ${i++}`,
reinit: false
value: 'Updated Name'
})
}, 100)
}
})
}
</script>
7 changes: 4 additions & 3 deletions methods/update-row.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
data-toggle="table"
data-toolbar="#toolbar"
data-height="428"
data-search="true"
data-url="json/data1.json">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">Item Name</th>
<th data-field="price">Item Price</th>
<th data-field="id" data-sortable="true">ID</th>
<th data-field="name" data-sortable="true">Item Name</th>
<th data-field="price" data-sortable="true">Item Price</th>
</tr>
</thead>
</table>
Expand Down
35 changes: 35 additions & 0 deletions options/buttons-attribute-title.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<script>
init({
title: 'Buttons Attribute Title',
desc: 'Customize the title attribute of the toolbar buttons, which is mainly used to customize the toolbar style.',
links: [
'https://unpkg.com/[email protected]/src/hint-css.css',
'bootstrap-table.min.css'
],
scripts: [
'https://unpkg.com/[email protected]/src/hint-css.js',
'bootstrap-table.min.js'
]
})
</script>

<table
id="table"
data-toggle="table"
data-height="460"
data-search="true"
data-show-pagination-switch="true"
data-show-refresh="true"
data-show-toggle="true"
data-show-columns="true"
data-show-fullscreen="true"
data-buttons-attribute-title="data-hint"
data-url="json/data1.json">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">Item Name</th>
<th data-field="price">Item Price</th>
</tr>
</thead>
</table>
9 changes: 8 additions & 1 deletion options/search-highlight.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@
<tr>
<th data-field="id">ID</th>
<th data-field="name">Item Name</th>
<th data-field="price">Item Price</th>
<th data-field="price" data-formatter="priceFormatter">Item Price</th>
</tr>
</thead>
</table>

<script>
function priceFormatter (value, row) {
return `<span>${value}</span>
<span style="margin-left: 5px">(${row.name})</span>`
}
</script>
2 changes: 1 addition & 1 deletion options/table-locale.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
links: ['bootstrap-table.min.css'],
scripts: [
'bootstrap-table.min.js',
'https://cdn.jsdelivr.net/npm/[email protected].1/dist/bootstrap-table-locale-all.min.js'
'https://cdn.jsdelivr.net/npm/[email protected].2/dist/bootstrap-table-locale-all.min.js'
]
})
</script>
Expand Down
4 changes: 2 additions & 2 deletions template-bootstrap-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/hint.min.css">
<link rel="stylesheet" href="assets/css/docs.min.css">
<link rel="stylesheet" href="assets/css/template.css?v=914">
<link rel="stylesheet" href="assets/css/template.css?v=924">
<style>
.form-inline .form-group {
display: inline;
Expand All @@ -31,7 +31,7 @@
<script src="https://cdn.jsdelivr.net/npm/@highlightjs/[email protected]/highlight.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/marked.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/flexibility.min.js"></script>
<script src="assets/js/template.js?v=914"></script>
<script src="assets/js/template.js?v=924"></script>

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-132747866-1"></script>
Expand Down
4 changes: 2 additions & 2 deletions template-bootstrap3.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@highlightjs/[email protected]/styles/default.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/hint.min.css">
<link rel="stylesheet" href="assets/css/docs.min.css">
<link rel="stylesheet" href="assets/css/template.css?v=914">
<link rel="stylesheet" href="assets/css/template.css?v=924">

<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/sprintf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@highlightjs/[email protected]/highlight.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/marked.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/flexibility.min.js"></script>
<script src="assets/js/template.js?v=914"></script>
<script src="assets/js/template.js?v=924"></script>

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-132747866-1"></script>
Expand Down
4 changes: 2 additions & 2 deletions template-bootstrap4.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@highlightjs/[email protected]/styles/default.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/hint.min.css">
<link rel="stylesheet" href="assets/css/docs.min.css">
<link rel="stylesheet" href="assets/css/template.css?v=914">
<link rel="stylesheet" href="assets/css/template.css?v=924">

<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"></script>
Expand All @@ -22,7 +22,7 @@
<script src="https://cdn.jsdelivr.net/npm/@highlightjs/[email protected]/highlight.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/marked.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/flexibility.min.js"></script>
<script src="assets/js/template.js?v=914"></script>
<script src="assets/js/template.js?v=924"></script>

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-132747866-1"></script>
Expand Down
Loading

0 comments on commit 1db38a3

Please sign in to comment.