Bootstrap表更新内容不起作用

编程入门 行业动态 更新时间:2024-10-28 02:35:22
本文介绍了Bootstrap表更新内容不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用wenzhinxin的引导程序表但无法更新表格内容。

I'm using wenzhinxin's bootstrap table but having trouble updating the table content.

我有两张桌子。一个显示所有员工,另一个显示所提到的第一个表中所选员工的报告。

I have two tables. One displaying all employees and the other displaying reports of the selected employee from the first table mentioned.

当点击第一个表中的员工时,我调用此代码来更新数据我的第二张桌子:

when clicking an employee in the first table i call this code to update the data of my second table:

$('#report-table').bootstrapTable('showLoading'); $.ajax({ type : "POST", url : "getReportsForEmployee.php", data : "id=" + row['id'], dataType:"json", success : function(data) { $('#report-table').bootstrapTable('hideLoading'); $('#notification').hide(); $('#report-table').bootstrapTable({ data: data }); }

我第一次点击员工时,报告会正确加载到我的第二个表中,但是第二次我点击一个员工(或第三次等),表格不再更新。我检查了谷歌浏览器中的网络流量,以验证我收到了正确的回复,我可以确认响应因员工而异点击。表格似乎只是在我第一次设置数据属性时更新其内容。

The first time i click an employee, the reports are loaded correctly into my second table, but the second time i click an employee (or third etc) the table is not updated anymore. I checked my network traffic in google chrome to verify that i receive the correct response which i do and i can confirm that the response varies depending on which employee i click. The table seems only to update its content the first time i set the data property.

推荐答案

想我必须更新这个问题,因为我很久以前就找到了答案。

Figured i had to update this question, since i found the answer long time ago.

Wh我失踪的是在设置数据属性时调用加载函数:

What i was missing was calling the load function when the data property was set:

$('#report-table').bootstrapTable('load', data);

更多推荐

Bootstrap表更新内容不起作用

本文发布于:2023-07-10 08:33:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1089856.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不起作用   内容   Bootstrap

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!