Hitachi Vantara Pentaho Community Forums
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Can table component link to another Dashboard?

  1. #1
    Join Date
    Aug 2009
    Posts
    122

    Default Can table component link to another Dashboard?

    i have noticed that JFreeChart component can link to another Dashboard through urlTemplate.
    if I create JFreeChart component with "Link to another Dashboard" in Pentaho Dashboard Editor, the "URLTemplate" value is "/pentaho/content/pentaho-cdf-dd/Render?solution=oracle&path=/&file=test.wcdf&paramp1={PARAM}"
    So far as i know, table component is clickable with click function. But i wonder that whether some code in click function can make table component link to another Dashboard?

    Thanks in advance.

  2. #2
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    exactly the same as in the chart, use the same code. Something like window.location.href="pentaho/content/pentaho-cdf-dd/Render?solution=oracle&path=/&file=test.wcdf&paramp1="+myself.value ...
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  3. #3
    Join Date
    Aug 2009
    Posts
    122

    Default

    Quote Originally Posted by pmalves View Post
    exactly the same as in the chart, use the same code. Something like window.location.href="pentaho/content/pentaho-cdf-dd/Render?solution=oracle&path=/&file=test.wcdf&paramp1="+myself.value ...
    Thanks in advance, pmalves. You really help me a lot. You are my HERO!!!

    However i have another question about clickable table component.
    I found that if you change var cols = $("#sampleObject td:nth-child(1,2)");, you can click both first and second column. So here is the problem: How can i know which cloumn did i just click?

    My way is to handle the value base on their value type, first column may be string and second column may be number if you have lucky. But what if first and second column are both string?

    Thanks for any hint!

  4. #4
    Join Date
    Aug 2009
    Posts
    122

    Default

    may be i should read some book about jQuery to find it out.

  5. #5
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    If you need different behaviors on those 2 cols, I'd just bind 2 different functions. It's possible to find out which element was clicked but... why make it harder?
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  6. #6
    Join Date
    Aug 2009
    Posts
    122

    Default

    Quote Originally Posted by pmalves View Post
    If you need different behaviors on those 2 cols, I'd just bind 2 different functions. It's possible to find out which element was clicked but... why make it harder?
    I understand what you said, i try to do that but i failed...
    Code:
    var clickFunctionab = function(){
     alert("You clicked on123: " + $(this).text())
    }
    
    var topTenCustomers =
     {
      name: "topTenCustomers",
      type: "tableComponent",
      chartDefinition: MetaLayerHome2.topTenCustomerDefinition,
      htmlObject: "sampleObject",
      executeAtStart: true,
      postExecution: function(){
       var cols = $("#sampleObject td:nth-child(1)");
       cols.die("click");
       cols.live("click",clickFunction);
    }
    the code above is from Pedro Alves , it does make me to click the first column of table.
    So i try to add some code in postExecution()
    Code:
      var cols = $("#sampleObject td:nth-child(1)");
       cols.die("click");
       cols.live("click",clickFunction);
    
     var cols2 = $("#sampleObject td:nth-child(2)");
       cols2.die("click");
       cols2.live("click",clickFunction);
    when i run it, i found only the second column can be clicked. whatever i change the code, it didn't work.
    Can pmalves give me some hint?

  7. #7
    Join Date
    Aug 2009
    Posts
    122

    Default

    like 'pmalves' said "If you need different behaviors on those 2 cols, I'd just bind 2 different functions."

    who can give me some hint?

  8. #8
    Join Date
    Aug 2009
    Posts
    122

    Default

    i just solve it.

    code
    Code:
       var cols = $("#sampleObject td:nth-child(1)");
       var cols1 = $("#sampleObject td:nth-child(2)");
       
       
       cols.die("click");
       cols.die("mouseover");
       cols.die("mouseout");
       cols1.die("click");
       cols1.die("mouseover");
       cols1.die("mouseout");
    
    
       cols.live("click",clickFunction);
       cols.live("mouseover",mouseoverFunction);
       cols.live("mouseout",mouseoutFunction);
       cols1.live("click",clickFunction1);
       cols1.live("mouseover",mouseoverFunction);
       cols1.live("mouseout",mouseoutFunction);

  9. #9

    Default

    Hi All,

    I was wondering if it's possible to give colors to the row in the table component, like trafffic component that change colors according the values

    Thanks in advance

    NL

  10. #10
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    Yes, it is, you need to apply a function in the postexecution that conditionally sets the css according to the value of a cell
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

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.