| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <meta name="description" content="The Events API of Bootstrap Table.">
- <meta name="author" content="Zhixin Wen, and Bootstrap Table contributors">
- <meta name="generator" content="Jekyll v3.8.7">
- <meta name="keywords" content="bootstrap,table,pagination,checkbox,radio,datatables,css,css-framework,semantic,semantic-ui,bulma,material,material-design,materialize,foundation">
- <meta name="docsearch:language" content="en">
- <title>Events · Bootstrap Table</title>
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css"><!-- Documentation extras -->
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css">
- <link rel="stylesheet" href="/assets/css/docs.min.css">
- <link rel="stylesheet" href="/assets/css/style.css?m=9">
- <!-- Favicons -->
- <link rel="icon" href="/favicon.png">
- <script type="text/javascript">
- if (window !== top) // 判断当前的 window 对象是否是 top 对象
- top.location.href = window.location.href // 如果不是,将 top 对象的网址自动导向被嵌入网页的网址
- </script>
- </head>
- <body>
- <a class="skippy sr-only sr-only-focusable" href="#content">
- <span class="skippy-text">Skip to main content</span>
- </a>
- <header class="navbar navbar-expand navbar-dark flex-column flex-md-row bd-navbar">
- <a class="navbar-brand mr-0 mr-md-2" href="/" aria-label="Bootstrap">
- <img src="/favicon.png" width="36" height="36">
- </a>
- <div class="navbar-nav-scroll">
- <ul class="navbar-nav bd-navbar-nav flex-row">
- <li class="nav-item">
- <a class="nav-link "
- href="/">Home</a>
- </li>
- <li class="nav-item">
- <a class="nav-link active"
- href="/docs/getting-started/introduction/">
- Documentation
- </a>
- </li>
- <li class="nav-item ">
- <a class="nav-link" href="/themes">
- Themes
- </a>
- </li>
- <li class="nav-item">
- <a class="nav-link "
- href="https://examples.bootstrap-table.com">
- Examples
- </a>
- </li>
- <li class="nav-item">
- <a class="nav-link"
- href="https://live.bootstrap-table.com"
- target="_blank">
- Online Editor
- </a>
- </li>
- <li class="nav-item ">
- <a class="nav-link" href="/news">
- News
- </a>
- </li>
- <li class="nav-item">
- <a class="nav-link"
- href="https://blog.bootstrap-table.com"
- target="_blank">
- Blog
- </a>
- </li>
- </ul>
- </div>
- <ul class="navbar-nav flex-row ml-md-auto d-none d-md-flex">
- <li class="nav-item dropdown">
- <a class="nav-item nav-link dropdown-toggle mr-md-2" href="#" id="bd-versions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- v1.23.5
- </a>
- <div class="dropdown-menu dropdown-menu-md-right" aria-labelledby="bd-versions">
- <a class="dropdown-item active" href="/">Latest (1.23.5)</a>
-
- <a class="dropdown-item" href="http://bootstrap-table.com/versions/1.21.4/" target="_blank">v1.21.4</a>
-
- <a class="dropdown-item" href="http://bootstrap-table.com/versions/1.20.2/" target="_blank">v1.20.2</a>
-
- <a class="dropdown-item" href="http://bootstrap-table.com/versions/1.19.1/" target="_blank">v1.19.1</a>
-
- <a class="dropdown-item" href="http://bootstrap-table.com/versions/1.18.3/" target="_blank">v1.18.3</a>
-
- <a class="dropdown-item" href="http://bootstrap-table.com/versions/1.17.1/" target="_blank">v1.17.1</a>
-
- <a class="dropdown-item" href="http://bootstrap-table.com/versions/1.16.0/" target="_blank">v1.16.0</a>
-
- <a class="dropdown-item" href="http://bootstrap-table.com/versions/1.15.5/" target="_blank">v1.15.5</a>
-
- </div>
- </li>
- <li class="nav-item">
- <a class="nav-link p-2" href="https://github.com/wenzhixin/bootstrap-table" target="_blank" rel="noopener" aria-label="GitHub"><svg class="navbar-nav-svg" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 512 499.36" focusable="false" role="img"><path d="M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z" fill="currentColor" fill-rule="evenodd"/></svg>
- </a>
- </li>
- <li class="nav-item">
- <a class="nav-link p-2" href="https://twitter.com/wenzhixin2010" target="_blank" rel="noopener" aria-label="Twitter"><svg class="navbar-nav-svg" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 512 416.32" focusable="false" role="img"><path d="M160.83 416.32c193.2 0 298.92-160.22 298.92-298.92 0-4.51 0-9-.2-13.52A214 214 0 0 0 512 49.38a212.93 212.93 0 0 1-60.44 16.6 105.7 105.7 0 0 0 46.3-58.19 209 209 0 0 1-66.79 25.37 105.09 105.09 0 0 0-181.73 71.91 116.12 116.12 0 0 0 2.66 24c-87.28-4.3-164.73-46.3-216.56-109.82A105.48 105.48 0 0 0 68 159.6a106.27 106.27 0 0 1-47.53-13.11v1.43a105.28 105.28 0 0 0 84.21 103.06 105.67 105.67 0 0 1-47.33 1.84 105.06 105.06 0 0 0 98.14 72.94A210.72 210.72 0 0 1 25 370.84a202.17 202.17 0 0 1-25-1.43 298.85 298.85 0 0 0 160.83 46.92" fill="currentColor"/></svg>
- </a>
- </li>
- <li class="nav-item">
- <a class="nav-link p-2" href="https://opencollective.com/bootstrap-table" target="_blank" rel="noopener" aria-label="Open Collective"><svg class="navbar-nav-svg" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 40 41" focusable="false" role="img" fill="currentColor" fill-rule="evenodd"><title>Open Collective</title><path d="M32.8 21c0 2.4-.8 4.9-2 6.9l5.1 5.1c2.5-3.4 4.1-7.6 4.1-12 0-4.6-1.6-8.8-4-12.2L30.7 14c1.2 2 2 4.3 2 7z" fill-opacity=".4"/><path d="M20 33.7a12.8 12.8 0 0 1 0-25.6c2.6 0 5 .7 7 2.1L32 5a20 20 0 1 0 .1 31.9l-5-5.2a13 13 0 0 1-7 2z"/></svg>
- </a>
- </li>
- </ul>
- <a class="btn btn-bd-download d-none d-lg-inline-block mb-3 mb-md-0 ml-md-3"
- href="/docs/getting-started/download/">Download</a>
- </header>
- <div class="container-fluid">
- <div class="row flex-xl-nowrap">
- <div class="col-12 col-md-3 col-xl-2 bd-sidebar">
- <form class="bd-search d-flex align-items-center">
- <input type="search" class="form-control"
- id="search-input" placeholder="Search..."
- aria-label="Search for..." autocomplete="off">
- <button class="btn btn-link bd-search-docs-toggle d-md-none p-0 ml-3"
- type="button" data-toggle="collapse" data-target="#bd-docs-nav"
- aria-controls="bd-docs-nav" aria-expanded="false"
- aria-label="Toggle docs navigation"><svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 30 30" width="30" height="30" focusable="false" role="img"><title>Menu</title><path stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" d="M4 7h22M4 15h22M4 23h22"/></svg>
- </button>
- </form>
- <nav class="collapse bd-links" id="bd-docs-nav"><div class="bd-toc-item">
- <a class="bd-toc-link" href="/docs/getting-started/introduction/">
- Getting started
- </a>
- <ul class="nav bd-sidenav"><li>
- <a href="/docs/getting-started/introduction/">
- Introduction
- </a>
- </li><li>
- <a href="/docs/getting-started/download/">
- Download
- </a>
- </li><li>
- <a href="/docs/getting-started/contents/">
- Contents
- </a>
- </li><li>
- <a href="/docs/getting-started/usage/">
- Usage
- </a>
- </li><li>
- <a href="/docs/getting-started/browsers-devices/">
- Browsers & devices
- </a>
- </li><li>
- <a href="/docs/getting-started/build-tools/">
- Build tools
- </a>
- </li></ul>
- </div><div class="bd-toc-item active">
- <a class="bd-toc-link" href="/docs/api/table-options/">
- API
- </a>
- <ul class="nav bd-sidenav"><li>
- <a href="/docs/api/table-options/">
- Table Options
- </a>
- </li><li>
- <a href="/docs/api/column-options/">
- Column Options
- </a>
- </li><li class="active bd-sidenav-active">
- <a href="/docs/api/events/">
- Events
- </a>
- </li><li>
- <a href="/docs/api/methods/">
- Methods
- </a>
- </li><li>
- <a href="/docs/api/localizations/">
- Localizations
- </a>
- </li></ul>
- </div><div class="bd-toc-item">
- <a class="bd-toc-link" href="/docs/extensions/addrbar/">
- Extensions
- </a>
- <ul class="nav bd-sidenav"><li>
- <a href="/docs/extensions/addrbar/">
- Addrbar
- </a>
- </li><li>
- <a href="/docs/extensions/auto-refresh/">
- Auto Refresh
- </a>
- </li><li>
- <a href="/docs/extensions/cookie/">
- Cookie
- </a>
- </li><li>
- <a href="/docs/extensions/copy-rows/">
- Copy Rows
- </a>
- </li><li>
- <a href="/docs/extensions/custom-view/">
- Custom View
- </a>
- </li><li>
- <a href="/docs/extensions/defer-url/">
- Defer URL
- </a>
- </li><li>
- <a href="/docs/extensions/editable/">
- Editable
- </a>
- </li><li>
- <a href="/docs/extensions/export/">
- Export
- </a>
- </li><li>
- <a href="/docs/extensions/filter-control/">
- Filter Control
- </a>
- </li><li>
- <a href="/docs/extensions/fixed-columns/">
- Fixed Columns
- </a>
- </li><li>
- <a href="/docs/extensions/group-by-v2/">
- Group By v2
- </a>
- </li><li>
- <a href="/docs/extensions/i18n-enhance/">
- i18n Enhance
- </a>
- </li><li>
- <a href="/docs/extensions/key-events/">
- Key Events
- </a>
- </li><li>
- <a href="/docs/extensions/mobile/">
- Mobile
- </a>
- </li><li>
- <a href="/docs/extensions/multiple-sort/">
- Multiple Sort
- </a>
- </li><li>
- <a href="/docs/extensions/page-jump-to/">
- Page Jump To
- </a>
- </li><li>
- <a href="/docs/extensions/pipeline/">
- Pipeline
- </a>
- </li><li>
- <a href="/docs/extensions/print/">
- Print
- </a>
- </li><li>
- <a href="/docs/extensions/reorder-columns/">
- Reorder Columns
- </a>
- </li><li>
- <a href="/docs/extensions/reorder-rows/">
- Reorder Rows
- </a>
- </li><li>
- <a href="/docs/extensions/resizable/">
- Resizable
- </a>
- </li><li>
- <a href="/docs/extensions/sticky-header/">
- Sticky Header
- </a>
- </li><li>
- <a href="/docs/extensions/toolbar/">
- Toolbar
- </a>
- </li><li>
- <a href="/docs/extensions/treegrid/">
- Treegrid
- </a>
- </li></ul>
- </div><div class="bd-toc-item">
- <a class="bd-toc-link" href="/docs/vuejs/introduction/">
- VueJS
- </a>
- <ul class="nav bd-sidenav"><li>
- <a href="/docs/vuejs/introduction/">
- Introduction
- </a>
- </li><li>
- <a href="/docs/vuejs/browser/">
- Browser
- </a>
- </li><li>
- <a href="/docs/vuejs/webpack/">
- Webpack
- </a>
- </li><li>
- <a href="/docs/vuejs/component/">
- Component
- </a>
- </li></ul>
- </div><div class="bd-toc-item">
- <a class="bd-toc-link" href="/docs/online-editor/">
- Online Editor
- </a>
- <ul class="nav bd-sidenav"></ul>
- </div><div class="bd-toc-item">
- <a class="bd-toc-link" href="/docs/faq/">
- FAQ
- </a>
- <ul class="nav bd-sidenav"></ul>
- </div><div class="bd-toc-item">
- <a class="bd-toc-link" href="/docs/about/overview/">
- About
- </a>
- <ul class="nav bd-sidenav"><li>
- <a href="/docs/about/overview/">
- Overview
- </a>
- </li><li>
- <a href="/docs/about/team/">
- Team
- </a>
- </li><li>
- <a href="/docs/about/license/">
- License
- </a>
- </li><li>
- <a href="/docs/about/translations/">
- Translations
- </a>
- </li></ul>
- </div></nav>
- </div>
-
- <div class="d-none d-xl-block col-xl-2 bd-toc">
- <ul class="section-nav">
- <li class="toc-entry toc-h2"><a href="#onall">onAll</a></li>
- <li class="toc-entry toc-h2"><a href="#oncheck">onCheck</a></li>
- <li class="toc-entry toc-h2"><a href="#oncheckall">onCheckAll</a></li>
- <li class="toc-entry toc-h2"><a href="#onchecksome">onCheckSome</a></li>
- <li class="toc-entry toc-h2"><a href="#onclickcell">onClickCell</a></li>
- <li class="toc-entry toc-h2"><a href="#onclickrow">onClickRow</a></li>
- <li class="toc-entry toc-h2"><a href="#oncollapserow">onCollapseRow</a></li>
- <li class="toc-entry toc-h2"><a href="#oncolumnswitch">onColumnSwitch</a></li>
- <li class="toc-entry toc-h2"><a href="#oncolumnswitchall">onColumnSwitchAll</a></li>
- <li class="toc-entry toc-h2"><a href="#ondblclickcell">onDblClickCell</a></li>
- <li class="toc-entry toc-h2"><a href="#ondblclickrow">onDblClickRow</a></li>
- <li class="toc-entry toc-h2"><a href="#onexpandrow">onExpandRow</a></li>
- <li class="toc-entry toc-h2"><a href="#onloaderror">onLoadError</a></li>
- <li class="toc-entry toc-h2"><a href="#onloadsuccess">onLoadSuccess</a></li>
- <li class="toc-entry toc-h2"><a href="#onpagechange">onPageChange</a></li>
- <li class="toc-entry toc-h2"><a href="#onpostbody">onPostBody</a></li>
- <li class="toc-entry toc-h2"><a href="#onpostfooter">onPostFooter</a></li>
- <li class="toc-entry toc-h2"><a href="#onpostheader">onPostHeader</a></li>
- <li class="toc-entry toc-h2"><a href="#onprebody">onPreBody</a></li>
- <li class="toc-entry toc-h2"><a href="#onrefresh">onRefresh</a></li>
- <li class="toc-entry toc-h2"><a href="#onrefreshoptions">onRefreshOptions</a></li>
- <li class="toc-entry toc-h2"><a href="#onresetview">onResetView</a></li>
- <li class="toc-entry toc-h2"><a href="#onscrollbody">onScrollBody</a></li>
- <li class="toc-entry toc-h2"><a href="#onsearch">onSearch</a></li>
- <li class="toc-entry toc-h2"><a href="#onsort">onSort</a></li>
- <li class="toc-entry toc-h2"><a href="#ontoggle">onToggle</a></li>
- <li class="toc-entry toc-h2"><a href="#ontogglepagination">onTogglePagination</a></li>
- <li class="toc-entry toc-h2"><a href="#onuncheck">onUncheck</a></li>
- <li class="toc-entry toc-h2"><a href="#onuncheckall">onUncheckAll</a></li>
- <li class="toc-entry toc-h2"><a href="#onunchecksome">onUncheckSome</a></li>
- <li class="toc-entry toc-h2"><a href="#onvirtualscroll">onVirtualScroll</a></li>
- </ul>
- </div>
-
- <main class="col-12 col-md-9 col-xl-8 py-md-3 pl-md-5 bd-content api" role="main">
- <div class="d-md-flex flex-md-row-reverse align-items-center justify-content-between">
- <a class="btn btn-sm btn-bd-light mb-2 mb-md-0"
-
- href="https://github.com/wenzhixin/bootstrap-table/blob/develop/site/docs/api/events.md"
-
- title="View and edit this file on GitHub" target="_blank" rel="noopener">
- View on GitHub
- </a>
- <h1 class="bd-title" id="content">
- Events
- </h1>
- </div>
- <p class="bd-lead">The Events API of Bootstrap Table.</p>
- <div id="gg"></div>
- <p>Events can be bound in two ways:</p>
- <ul>
- <li>via the option object</li>
- <li>via jquery event handler</li>
- </ul>
- <p>Binding via the options object:</p>
- <figure class="highlight"><pre><code class="language-html" data-lang="html">// Here, you can expect to have as the last parameter the bootstrap-table object
- $('#table').bootstrapTable({
- onEventName: function (arg1, arg2, ...) {
- // ...
- }
- })</code></pre></figure>
- <p>Binding via the jquery event handler:</p>
- <figure class="highlight"><pre><code class="language-html" data-lang="html">// Here, you can expect to have in the 'e' variable the sender property, which is the bootstrap-table object
- $('#table').on('event-name.bs.table', function (e, arg1, arg2, ...) {
- // ...
- })</code></pre></figure>
- <p><em>Hint: if you use the jquery event handler, make sure to bind the event listener before the event is executed!</em></p>
- <h2 id="onall">onAll</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">all.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">name, args</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when any event triggers. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">name</code>: the event name,</li>
- <li><code class="highlighter-rouge">args</code>: the event data.</li>
- </ul>
- </li>
- </ul>
- <h2 id="oncheck">onCheck</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">check.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">row, $element</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when the user checks a row. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">row</code>: the record corresponding to the clicked row.</li>
- <li><code class="highlighter-rouge">$element</code>: the DOM element checked.</li>
- </ul>
- </li>
- </ul>
- <h2 id="oncheckall">onCheckAll</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">check-all.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">rowsAfter, rowsBefore</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when the user checks all rows. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">rowsAfter</code>: array of records of the now checked rows.</li>
- <li><code class="highlighter-rouge">rowsBefore</code>: array of records of the checked rows before.</li>
- </ul>
- </li>
- </ul>
- <h2 id="onchecksome">onCheckSome</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">check-some.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">rows</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when the user checks some rows. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">rows</code>: array of records corresponding to newly checked rows.</li>
- </ul>
- </li>
- </ul>
- <h2 id="onclickcell">onClickCell</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">click-cell.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">field, value, row, $element</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when the user clicks a cell. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">field</code>: the field name corresponding to the clicked cell.</li>
- <li><code class="highlighter-rouge">value</code>: the data value corresponding to the clicked cell.</li>
- <li><code class="highlighter-rouge">row</code>: the record corresponding to the clicked row.</li>
- <li><code class="highlighter-rouge">$element</code>: the td element.</li>
- </ul>
- </li>
- </ul>
- <h2 id="onclickrow">onClickRow</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">click-row.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">row, $element, field</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when the user clicks a row. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">row</code>: the record corresponding to the clicked row.</li>
- <li><code class="highlighter-rouge">$element</code>: the tr element.</li>
- <li><code class="highlighter-rouge">field</code>: the field name corresponding to the clicked cell.</li>
- </ul>
- </li>
- </ul>
- <h2 id="oncollapserow">onCollapseRow</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">collapse-row.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">index, row, detailView</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when you click the detail icon to collapse the detail view. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">index</code>: the index of the collapsed row.</li>
- <li><code class="highlighter-rouge">row</code>: the record corresponding to the collapsed row.</li>
- <li><code class="highlighter-rouge">detailView</code>: the collapsed detailView.</li>
- </ul>
- </li>
- </ul>
- <h2 id="oncolumnswitch">onColumnSwitch</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">column-switch.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">field, checked</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when switch the column visible (<a href="/docs/api/table-options/#showcolumns">showColumns</a>). The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">field</code>: the field name corresponding to the switch column.</li>
- <li><code class="highlighter-rouge">checked</code>: the checked state of the column.</li>
- </ul>
- </li>
- </ul>
- <h2 id="oncolumnswitchall">onColumnSwitchAll</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">column-switch-all.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">checked</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when toggle all columns. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">checked</code>: the checked state of the column.</li>
- </ul>
- </li>
- </ul>
- <h2 id="ondblclickcell">onDblClickCell</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">dbl-click-cell.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">field, value, row, $element</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when the user double click a cell. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">field</code>: the field name corresponding to the clicked cell.</li>
- <li><code class="highlighter-rouge">value</code>: the data value corresponding to the clicked cell.</li>
- <li><code class="highlighter-rouge">row</code>: the record corresponding to the clicked row.</li>
- <li><code class="highlighter-rouge">$element</code>: the td element.</li>
- </ul>
- </li>
- </ul>
- <h2 id="ondblclickrow">onDblClickRow</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">dbl-click-row.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">row, $element, field</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when the user doubles click a row. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">row</code>: the record corresponding to the clicked row.</li>
- <li><code class="highlighter-rouge">$element</code>: the tr element.</li>
- <li><code class="highlighter-rouge">field</code>: the field name corresponding to the clicked cell.</li>
- </ul>
- </li>
- </ul>
- <h2 id="onexpandrow">onExpandRow</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">expand-row.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">index, row, $detail</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when you click the detail icon to expand the detail view. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">index</code>: the index of the expanded row.</li>
- <li><code class="highlighter-rouge">row</code>: the record corresponding to the expanded row.</li>
- <li><code class="highlighter-rouge">$detail</code>: the DOM element of the detail <code class="highlighter-rouge">div</code> after the current <code class="highlighter-rouge">tr</code> element, you can use jQuery methods to custom the detail views.</li>
- </ul>
- </li>
- </ul>
- <h2 id="onloaderror">onLoadError</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">load-error.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">status, jqXHR</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when some errors occur to load remote data. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">status</code>: the status code of <code class="highlighter-rouge">jqXHR</code>.</li>
- <li><code class="highlighter-rouge">jqXHR</code>: jqXHR object, which is a super set of the XMLHTTPRequest object. For more information, see the <a href="http://api.jquery.com/Types/#jqXHR">jqXHR Type</a>.</li>
- </ul>
- </li>
- </ul>
- <h2 id="onloadsuccess">onLoadSuccess</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">load-success.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">data</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when remote data is loaded successfully. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">data</code>: the remote data loaded into the table. (Note: this data cannot be modified once it’s loaded into the table. If you need to process received data before using it in the table, write your custom <a href="/docs/api/table-options/#responsehandler">responseHandler</a> instead.)</li>
- <li><code class="highlighter-rouge">status</code>: the status code of <code class="highlighter-rouge">jqXHR</code>.</li>
- <li><code class="highlighter-rouge">jqXHR</code>: jqXHR object, which is a super set of the XMLHTTPRequest object. For more information, see the <a href="http://api.jquery.com/Types/#jqXHR">jqXHR Type</a>.</li>
- </ul>
- </li>
- </ul>
- <h2 id="onpagechange">onPageChange</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">page-change.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">number, size</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when changing the page number or page size. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">number</code>: the page number.</li>
- <li><code class="highlighter-rouge">size</code>: the page size.</li>
- </ul>
- </li>
- </ul>
- <h2 id="onpostbody">onPostBody</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">post-body.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">data</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires after the table body are rendered and available in the DOM. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">data</code>: the rendered data.</li>
- </ul>
- </li>
- </ul>
- <h2 id="onpostfooter">onPostFooter</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">post-footer.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">$tableFooter</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires after the footer are rendered and available in the DOM. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">$tableFooter</code>: the DOM element of the footer.</li>
- </ul>
- </li>
- </ul>
- <h2 id="onpostheader">onPostHeader</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">post-header.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">undefined</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires after the table header is rendered and available in the DOM.</p>
- </li>
- </ul>
- <h2 id="onprebody">onPreBody</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">pre-body.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">data</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires before the table body are rendered. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">data</code>: the rendered data.</li>
- </ul>
- </li>
- </ul>
- <h2 id="onrefresh">onRefresh</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">refresh.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">params</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires after the click of the refresh button. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">params</code>: the additional parameters request to the server.</li>
- </ul>
- </li>
- </ul>
- <h2 id="onrefreshoptions">onRefreshOptions</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">refresh-options.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">options</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires after refreshing the options, and before destroying and init the table. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">options</code>: the table options object.</li>
- </ul>
- </li>
- </ul>
- <h2 id="onresetview">onResetView</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">reset-view.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">undefined</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when resetting the view of the table.</p>
- </li>
- </ul>
- <h2 id="onscrollbody">onScrollBody</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">scroll-body.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">$tableBody</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when the table body scroll.</p>
- <h2 id="onsearch">onSearch</h2>
- </li>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">search.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">text</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when searching the table. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">text</code>: the text of the search input.</li>
- </ul>
- </li>
- </ul>
- <h2 id="onsort">onSort</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">sort.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">name, order</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when the user sort a column. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">name</code>: the sort column field name.</li>
- <li><code class="highlighter-rouge">order</code>: the sort column order.</li>
- </ul>
- </li>
- </ul>
- <h2 id="ontoggle">onToggle</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">toggle.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">cardView</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when toggling the view of the table. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">cardView</code>: the cardView state of the table.</li>
- </ul>
- </li>
- </ul>
- <h2 id="ontogglepagination">onTogglePagination</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">toggle-pagination.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">state</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when the pagination is toggled:</p>
- <ul>
- <li><code class="highlighter-rouge">state</code>: the new pagination state (<code class="highlighter-rouge">true</code>-> Pagination is enabled, <code class="highlighter-rouge">false</code> -> Pagination is disabled )</li>
- </ul>
- </li>
- </ul>
- <h2 id="onuncheck">onUncheck</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">uncheck.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">row, $element</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when the user unchecks a row. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">row</code>: the record corresponding to the clicked row.</li>
- <li><code class="highlighter-rouge">$element</code>: the DOM element unchecked.</li>
- </ul>
- </li>
- </ul>
- <h2 id="onuncheckall">onUncheckAll</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">uncheck-all.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">rowsAfter, rowsBefore</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when the user unchecks all rows. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">rowsAfter</code>: array of records of the now checked rows.</li>
- <li><code class="highlighter-rouge">rowsBefore</code>: array of records of the checked rows before.</li>
- </ul>
- </li>
- </ul>
- <h2 id="onunchecksome">onUncheckSome</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">uncheck-some.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">rows</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when the user unchecks some rows. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">rows</code>: array of records corresponding to previously checked rows.</li>
- </ul>
- </li>
- </ul>
- <h2 id="onvirtualscroll">onVirtualScroll</h2>
- <ul>
- <li>
- <p><strong>jQuery Event:</strong> <code class="highlighter-rouge">virtual-scroll.bs.table</code></p>
- </li>
- <li>
- <p><strong>Parameter:</strong> <code class="highlighter-rouge">startIndex, endIndex</code></p>
- </li>
- <li>
- <p><strong>Detail:</strong></p>
- <p>It fires when the user scrolls the virtual scroll. The parameters contain:</p>
- <ul>
- <li><code class="highlighter-rouge">startIndex</code>: the start row index of the virtual scroll.</li>
- <li><code class="highlighter-rouge">endIndex</code>: the end row index of the virtual scroll.</li>
- </ul>
- </li>
- </ul>
- </main>
- </div>
- </div>
- <script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
- <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
- <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.min.js"></script>
- <script async defer src="https://buttons.github.io/buttons.js"></script><script src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
- <script>
- $(function () {
- $('.bd-content.api a').attr('target', '_blank')
- })
- </script><script src="https://gg.wenzhixin.net.cn/bootstrap-table/gg.js"></script>
- <script src="/assets/js/docs.min.js?m=1"></script>
- <!-- Global site tag (gtag.js) - Google Analytics -->
- <script async src="https://www.googletagmanager.com/gtag/js?id=UA-132747866-1"></script>
- <script>
- window.dataLayer = window.dataLayer || []
- function gtag() {window.dataLayer.push(arguments)}
- gtag('js', new Date())
- gtag('config', 'UA-132747866-1')
- </script>
- </body>
- </html>
|