无法获取 Oracle Jet ojetable 中选定行的值

can't get the values of selected row in Oracle Jet ojetable

我有一个 oracle jet table 就像那样

 <table data-bind="event: {ojbeforecurrentrow: currentRowListener},
      selectionMode: {row: 'single'},
      ojComponent: {component: 'ojTable', 
        data: dataSource,
        columns: [
            {headerText: 'Student Id', field: 'Id'},
            {headerText: 'FirstName', field: 'FirstName'},
            {headerText: 'LastName', field: 'LastName'},
            {headerText: 'BirthDate', field: 'BirthDate'},
            {headerText: 'Gender', field: 'Gender'}
        ]
    }">
</table> 

js 文件看起来像这样

self.currentRowListener = function (event,ui) {
      var current = ui.currentRow;
          alert(current);
           };

警报值为未定义,所以我无法获取所选行的值

在输入文本中设置

似乎是什么问题

你可以检查这个:

self.currentRowListener = function (event) {
     {
            var data = event.detail;
            var newCurrentRow = data.currentRow;
            alert(newCurrentRow );
            var oldCurrentRow = data.previousCurrentRow;

    }

供selectionListener参考 Oracle Jet Table Events