Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: about javascript,help

  1. #1
    Join Date
    May 2006
    Posts
    6

    Default about javascript,help

    table input <hr />> javascript <hr />> text output


    i want to generate new row in javascript
    how to do it?



    my table has 10 rows ,i want to generate 11 rows

  2. #2
    Join Date
    Nov 1999
    Posts
    9,729

    Default RE: about javascript,help

    Hi Sun,



    The easiest would probably be to copy a row and then change the values.
    Something like:
    <pre>
    var extraRow;

    if (extraRow == null)
    {
    extraRow = row.clone();
    // Modify this row
    _step_.putRow(extraRow);
    }
    </pre>


    As you can see from this example, you need to use the "hidden", undocumented object _step_ to help you out in this case.



    Hope this helps,



    Matt

  3. #3
    Join Date
    Nov 1999
    Posts
    9,729

    Default RE: about javascript,help

    Florent,

    It&#39;s undocumented because the _step_ object only apears at runtime (when there is a step thread allocated).
    So the "Check" button fails at present and I really don&#39;t know how to fix that.

    If you run it, it should work though.

    All the best,

    Matt

  4. #4
    Join Date
    Sep 2005
    Posts
    1,403

    Default RE: about javascript,help

    Hi Sun and Matt,





    this functionality is interesting but I don't understand how tu use it.
    _step_ is an object or we must give the name of the transformation ?
    If I try that :



    var extraRow = id.clone();
    _step_.putRow(extraRow);



    The javascript doesn't know : _step_



    Thank you, Florent

  5. #5
    Join Date
    Sep 2005
    Posts
    1,403

    Default RE: about javascript,help

    Ok it works perfectly!


    Thank you, Florent

  6. #6
    Join Date
    Sep 2005
    Posts
    1,403

    Default RE: about javascript,help

    ok! thanks

  7. #7
    Join Date
    May 2006
    Posts
    6

    Default RE: about javascript,help

    thanks MattCasters

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.