How to make this.getItem(id) work for treetable instead of a datatable?

edited October 2018 in Technical questions


I was using datatable to display a data set. In some cases, my data set may change so I changed from datatable to treetable.

However, earlier this.getItem(id) was working for datatable when used as below:

    $init: function(row){      
      console.log("this.getitem = "+JSON.stringify(this.getItem( )) ;     

In this example, the data set does not have any tree structure, so I am not using common.treetable() function for any of the columns.

But based on instances, I will have data set which are either simple like this example or tree structured, that is why I am using view:treetable.

Now, how can I make this.getItem(id ) work for treetable, currently it is returning undefined.




  • edited October 2018

    why are you trying to use getItem in scheme->$init?
    event if succeeded it will return the same object as row argument.

  • Hi intregal,

    While rendering, I have to alter certain column values as :

    this.getItem(id)['name'] = row.Name + "Something" ;

    This will happen based on certain other conditions purely related to the application requirement.

    So, I need it.


  • then use row['name'] = row.Name + "Something";

  • Thanks,
    is there any reason why this.getItem(id)['name'] should return undefined.
    I have used this for several other purposes as well.
    Am I doing anything wrong here ?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!