对数据表中新添加的列值进行排序不起作用 [英] Sorting newly added column values in datatable not working

查看:102
本文介绍了对数据表中新添加的列值进行排序不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含多个列的DataTable,并且排序功能对于除一个列之外的所有列均正常工作.

I have a DataTable which has multiple columns and the sorting function works correctly for all columns except one.

对于行不通的列,我稍后将在用户操作后执行惰性提取后将值添加到表中,而在呈现表时将加载列中的所有其他值.

For the column which doesn't work, I am adding the values to the table later on after doing a lazy fetch after a user action, whereas all other values in the columns are loaded when the table is rendered.

表是否有办法了解最新值,以便也可以对新列进行排序.要将文本添加到列中,请使用Jquery的.text函数.

Is there a way for the table to get to know the latest values so that the new column can be sorted as well. To add text to the column I use the .text function of Jquery.

推荐答案

cell().invalidate()函数 https://datatables.net/reference/api/cell().invalidate( )

The cell().invalidate() function https://datatables.net/reference/api/cell().invalidate()

或row().invalidate()函数 https://datatables.net/reference/api/row().invalidate( )

or row().invalidate() function https://datatables.net/reference/api/row().invalidate()

如果在您的懒惰提取中的回调中调用,可能会很有用.

Might be useful, if called in your callback from your Lazy Fetch.

这篇关于对数据表中新添加的列值进行排序不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆