Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Accessing this.datatable object

  1. #1

    Default Accessing this.datatable object

    Hi,

    In various threads i have seen mention of accessing this.dataTable in preExecution and/or postExecution.If I do console.log(this) in pre- or post- then I can see dataTable in there.

    However whenever I try to modify this.dataTable it shows undefined.

    I am using RequireJS and latest version of Ctools.

    Really can't work this one out

    Any help much appreciated.

  2. #2
    Join Date
    Jan 2014
    Posts
    189

    Default

    The object this.dataTable is (re)created after the component is fed with data, which means it is only available in postExecution (and not in preExecution nor in postFetch).

    In other words:
    - on the first execution this.dataTable only exists in postExecution
    - on subsequent executions, this.dataTable exists in all three callbacks, but if you use the object in preExecution or postFetch, it will be discarded as soon as data arrives.

  3. #3

    Default

    Thanks. Now I see it there on the second execution! Though it just tells me that I am doing things wrongly and I should be using the Extra Options to achieve my end result.

    Cheers

  4. #4
    Join Date
    Oct 2017
    Posts
    2

    Default

    I just can see this.dataTable on the second execution, even in postExecution. Is there any other way of accessing the dataTable on the first execution?

    I'm using Pentaho 7.0

  5. #5
    Join Date
    Jan 2014
    Posts
    189

    Default

    No. The object this.dataTable is created _after_ preExecution runs.

  6. #6
    Join Date
    Oct 2017
    Posts
    2

    Default

    Quote Originally Posted by crusso View Post
    No. The object this.dataTable is created _after_ preExecution runs.
    But even in postExecution I can't get this.dataTable at the first interaction. It seems that it is beeing created after postExecution...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.