在动态添加行时,stateave不能处理数据 [英] statesave not working with datatables when rows are added dynamically

查看:150
本文介绍了在动态添加行时,stateave不能处理数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用DataTables,我使用

I am using DataTables and I initialize the table with

$(document).ready(function() {
    $('#example').dataTable( {
        stateSave: true
    } );
} );

我使用$('#example')动态填充表。row.add(... )

I populate my table dynamically using $('#example').row.add(...)

当我重新加载或重新访问我的页面时,表格再次为空。 stateSave是否可以使用动态插入的行内容?

When I reload or revisit my page, the table is empty again. Is stateSave supposed to work with dynamically inserted row entires?

推荐答案

确保您已启用localstorage!自己动手了,没有启用这个问题。

Be sure that you have localstorage enabled! Encoutnered this myself and it wasn't enabled which caused the issue.

这篇关于在动态添加行时,stateave不能处理数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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