bootstrap-table-defer-url.js 945 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * When using server-side processing, the default mode of operation for
  3. * bootstrap-table is to simply throw away any data that currently exists in the
  4. * table and make a request to the server to get the first page of data to
  5. * display. This is fine for an empty table, but if you already have the first
  6. * page of data displayed in the plain HTML, it is a waste of resources. As
  7. * such, you can use data-defer-url instead of data-url to allow you to instruct
  8. * bootstrap-table to not make that initial request, rather it will use the data
  9. * already on the page.
  10. *
  11. * @author: Ruben Suarez
  12. * @webSite: http://rubensa.eu.org
  13. * @update zhixin wen <wenzhixin2010@gmail.com>
  14. */
  15. $.extend($.fn.bootstrapTable.defaults, {
  16. deferUrl: undefined
  17. })
  18. $.BootstrapTable = class extends $.BootstrapTable {
  19. init (...args) {
  20. super.init(...args)
  21. if (this.options.deferUrl) {
  22. this.options.url = this.options.deferUrl
  23. }
  24. }
  25. }