欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

boostrapTable的refresh和refreshOptions区别浅析

程序员文章站 2023-11-09 21:16:28
在使用bootstraptable时,刷新数据有两个方法refresh、refreshoptions,其用法相似:

在使用bootstraptable时,刷新数据有两个方法refresh、refreshoptions,其用法相似:

<table id="event_table"></table>
...
<script>
 $("#event_table").bootstraptable('refresh', {url: new_url });

 $("#event_table").bootstraptable('refreshoptions', {url:new_url});
</script>

refresh:从server端重新获取数据。

refreshoptions:更新bootstraptable options,并从server端获取数据。与refresh的区别在于,refreshoptions设置的option,会被作为下次请求server数据的默认option使用。

另外,使用refreshoptions时,注意bootstraptable的版本,一些老版本不支持该方法。

bootstraptable请求数据时设置超时(timeout)的方法

以上所述是小编给大家介绍的boostraptable的refresh和refreshoptions区别浅析,希望对大家有所帮助