Item inside <nuxeo-data-table-column> component passed to a function as an argument yields empty object

268 views Asked by At
<nuxeo-data-table-column>
  [[item.title]]
</nuxeo-data-table-column>

This works. Here 'item.title' renders title.

<nuxeo-data-table-column>
 [[_callme(item)]]
</nuxeo-data-table-column>

_callme: function (item) {
  console.log(item);
}

This doesn't work. Here 'item' is an empty object

Where my I wrong ?

1

There are 1 answers

0
Dipesh KC On BEST ANSWER

I end up fetching page provider manually and fed to 'items' property to 'nuxeo-data-table' which then works.

Template

<nuxeo-page-provider id="nxProvider">
  <nuxeo-data-table items="[[data.entries]]">
    <nuxeo-data-table-column>
      [[_callme(item)]]
    </nuxeo-data-table-column>
  </nuxeo-data-table>
</nuxeo-page-provider>

Script

 setIntialValue:function(){
            this.$.nxProvider.fetch().then(data=>{
               this.data = Object.assign({}, data);
             })
          }

 _callme: function (item) { console.log(item); } ->works