如何使用 jQuery 从 table 中获取某个值?

How to use jQuery to get a certain value from a table?

对于 Kendo.Grid 我有以下 html:

我有一个聚合函数,它构建了一个页脚行,其中包含行中所有金额的总和:Total: 91

我需要从网格中获取该文本。

我的网格有一个触发 javascript DeleteRecord 函数的点击按钮事件:

function DeleteRecord(e) {
    e.preventDefault(e);
    var grid = $("#TicketReportPropertyGrid").getKendoGrid();
    var row = $(e.target).closest("tr");
    var dataItem = grid.dataItem(row);
    dataItem.deleted = true;
    row.addClass('disabledGridRow');
    var totalArea = $('#TicketreportPropertyGrid table tfoot .k-footer-template td').eq(2).text();
    console.log(totalArea);
}

并且在尝试 console.log(totalArea) 时,它不会在控制台中打印任何内容

我如何使用 jQuery 来做到这一点?

$('#TicketReportPropertyGrid table tfoot .k-footer-template td').eq(2).text();
                                                  // third td ---^
                                               // get the innerText ---^