Jquery plugins 在初始化后更改现代jQuery数据表中的设置

Jquery plugins 在初始化后更改现代jQuery数据表中的设置,jquery-plugins,datatables,Jquery Plugins,Datatables,我正在使用新版本的DataTables(,而不是a)。我有一个初始的滚动值,希望在某些事件中更改它 我尝试了我能想象到的所有方法,但没有一种有效(请查看): 有两件非常令人困惑的事情: 第一:无法创建Api对象,如中所述: 第二:我可以在designer中看到所需字段,但无法按名称访问它(第一个请求中的其他字段由我裁剪): 我不知道,这是怎么可能的。下面是一个在legacy中如何实现的示例:我找到了这个案例的解决方法:$('.dataTables\u scrollBody').css('hei

我正在使用新版本的DataTables(,而不是a)。我有一个初始的
滚动
值,希望在某些事件中更改它

我尝试了我能想象到的所有方法,但没有一种有效(请查看):

有两件非常令人困惑的事情:

第一:无法创建Api对象,如中所述:

第二:我可以在designer中看到所需字段,但无法按名称访问它(第一个请求中的其他字段由我裁剪):


我不知道,这是怎么可能的。

下面是一个在legacy中如何实现的示例:我找到了这个案例的解决方法:
$('.dataTables\u scrollBody').css('height',100),但这并不能解决访问数据表设置的问题。
var dt = $('#example').DataTable({
        scrollY: "200px",
    });

$('#resize').click(function() {
    // Doesn't affect anything
    dt.settings({
        scrollY: "100px",
    });

    // TypeError: Cannot read property 'sY' of undefined
    dt.settings().oScroll.sY = "100px";

    // TypeError: undefined is not a function
    // http://datatables.net/reference/api/ doesn't work as described :(
    dt.Api();

    // To redraw table after
    dt.draw();
});
$('#example').DataTable().Api(); // undefined is not a function