alfajango / jquery-dynatable

A more-fun, semantic, alternative to datatables
http://www.dynatable.com
Other
2.78k stars 363 forks source link

After ajax update dynatable duplicate it's controls. #291

Open B-R-Bender opened 6 years ago

B-R-Bender commented 6 years ago

Hi! Thank for awsome tool!

when table loads for the firs time it looks fine, but when it updates controlls starts duplicatin each time after

    <div id="workersTab">
        <table id="workersTable" class="table">
            <thead>
            <tr>
                <th data-dynatable-column="id">Worker</th>
                <th data-dynatable-column="lastShare">Last Share</th>
                <th data-dynatable-column="rating">Rating</th>
                <th data-dynatable-column="hashrate">Hashrate</th>
            </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
    </div>

    <div id="calculatorTab">
        <table id="calculatorTable" class="table">
            <thead>
            <tr>
                <th data-dynatable-column="period">Period</th>
                <th data-dynatable-column="coins">ETH</th>
                <th data-dynatable-column="bitcoins">BTC</th>
                <th data-dynatable-column="dollars">USD</th>
            </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
    </div>

and this calls after ajax update

        convertWorkersData(responseData);
        var workersTable = $('#workersTable').dynatable({
            dataset: {
                records: responseData
            },
            features: {
                paginate: true,
                recordCount: false,
                search: false
            }
        }).data("dynatable");
        workersTable.settings.dataset.originalRecords = responseData;
        workersTable.process();

this issue only for firefox(55.0.1) and ie (11.0.9600.18378) chrome(62.0.3202.94) and opera(49.0.2725.47) works fine

it's looks loke this: http://puu.sh/yvQvj/c1222525ed.png http://puu.sh/yvQwc/14d8498b08.png

any suggestion?

setsune commented 6 years ago

Hello!

I believe it's because you're loading the features:object data after the ajax update again, which is causing the duplication of the controls.