簡體   English   中英

動態更新數據表行數

[英]Dynamically update dataTable Row Count

我正在嘗試在檢索數據時更新dataTable的row_count

我創建一個空的dataTable並將其呈現為myDiv

var dataTable = new Y.DataTable({
            columns: columns,
            footerView:   Y.FooterView,  
            footerConfig: {
                fixed:   true,
                heading: {
                    colspan:    3,
                    content:    "Number Records : {row_count}  "
                }
            }
        }).render("#myDiv");

單擊按鈕后,將通過IO請求填充dataTable。

var node = Y.one('#searchButton');
node.on(
            'click', 
            function() {
            dataSource = new Y.DataSource.IO({source:'mySource'});
            ...
            //code to set data in dataTable
            ...
            size = dataTable.data.size(); //retrieves the number of records, but row_count in the footer of course remains '0'

如何動態更新footerView 內容的'row_count'以反映大小

在#searchButton的“ click”上呈現我的表格時,將獲取行數並將其顯示在表格中:

var node = Y.one('#searchButton');
node.on(
    ...
    dataTable.render("#myDiv"); //renders the table to the Div, # of records and all

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM