2

プロジェクトで jtable を使い始めたばかりで、問題が発生しています。jTable インスタンスを作成した後、このインスタンスのいくつかの一般オプションを変更したいのですが、うまくいかないようです。

例えば、

 $(document).ready(function () {
$('#PersonTableContainer').jtable({
    title: 'Table of people',
    actions: {
        listAction: '/GettingStarted/PersonList',
        createAction: '/GettingStarted/CreatePerson',
        updateAction: '/GettingStarted/UpdatePerson',
        deleteAction: '/GettingStarted/DeletePerson'
    },
    fields: {
        PersonId: {
            key: true,
            list: false
        },
        Name: {
            title: 'Author Name',
            width: '40%'
        },
        Age: {
            title: 'Age',
            width: '20%'
        },
        RecordDate: {
            title: 'Record date',
            width: '30%',
            type: 'date',
            create: false,
            edit: false
        }
    }
});
$('#PersonTableContainer').jtable({ title:'chang title'});  //this doesn't work 
// below also doesn't work
$.extend(true, $.hik.jtable.prototype.options, {title: 'change title'} );
});

jtable の一般オプション、フィールド オプション、およびアクションを動的に変更するにはどうすればよいですか?

4

2 に答える 2

1

あなたが答えを見つけたと思いますが、同じ問題に遭遇し、これがテーブルのタイトルを変更するために機能することがわかりました:

$('#PersonTableContainer').find('.jtable-title-text').html('change title');
于 2014-02-22T16:19:44.107 に答える
0

オプション値は $.hik.jtable.prototype.options オブジェクトに格納されます。元。詳細については、 http$.hik.jtable.prototype.options.columnResizable = false; : //www.jtable.org/ApiReference#Overviewを参照してください。

于 2013-12-23T14:09:00.640 に答える