Hitachi Vantara Pentaho Community Forums
Results 1 to 9 of 9

Thread: Hide column table

  1. #1
    Join Date
    Nov 2012
    Posts
    3

    Default Hide column table

    Hi.
    I'm trying to hide the first column of a table component, but i can't.
    I've left blank the first column header and it doesn't work.

    How can i do it?


    Thanks a lot.

  2. #2
    Join Date
    Jan 2013
    Posts
    135

    Default

    Hi pascuti,

    there is an option Output options by Datasource. If you have 3 columns in query and first column should by hidden, than you write 1 and 2. If it should be first and third column, you write 0 and 2. A calculated value is seen as a next value to selected - 3 columns plus calculation, you can vary in Output options from 0 to 3.
    I hope it works.

    Best regards,
    timfu83

  3. #3
    Join Date
    Apr 2012
    Posts
    17

    Default

    Quote Originally Posted by timfu83 View Post
    Hi pascuti,

    there is an option Output options by Datasource. If you have 3 columns in query and first column should by hidden, than you write 1 and 2. If it should be first and third column, you write 0 and 2. A calculated value is seen as a next value to selected - 3 columns plus calculation, you can vary in Output options from 0 to 3.
    I hope it works.

    Best regards,
    timfu83
    So this works to hide the data from being displayed, but it also filters it completely.

    If I have a query that returns 6 columns, the last of which being a keyfield that is of no visual value, I want to hide it. I can do so in the "Output Options" of the datasource query.

    But now when I show the values I'm reading with:
    function click_table_func1(a){
    alert('Col 0:' + a.tableData[a.rowIdx][0] + '\n' +
    'Col 1:' + a.tableData[a.rowIdx][1] + '\n' +
    'Col 2:' + a.tableData[a.rowIdx][2] + '\n' +
    'Col 3:' + a.tableData[a.rowIdx][3] + '\n' +
    'Col 4:' + a.tableData[a.rowIdx][4] + '\n' +
    'Col 5:' + a.tableData[a.rowIdx][5] + '\n');
    }

    That last column is now undefined, and I no longer have that key value I needed to populate any subsequent tables/charts.

    How can I hide a column from the table, while still retaining the value on the back end?

    Thanks

    Using Pentaho Community edition 4.8.0 and CDE v13.06.05

  4. #4
    Join Date
    Apr 2012
    Posts
    17

    Default

    Quote Originally Posted by dmondra2 View Post
    So this works to hide the data from being displayed, but it also filters it completely.

    If I have a query that returns 6 columns, the last of which being a keyfield that is of no visual value, I want to hide it. I can do so in the "Output Options" of the datasource query.

    But now when I show the values I'm reading with:
    function click_table_func1(a){
    alert('Col 0:' + a.tableData[a.rowIdx][0] + '\n' +
    'Col 1:' + a.tableData[a.rowIdx][1] + '\n' +
    'Col 2:' + a.tableData[a.rowIdx][2] + '\n' +
    'Col 3:' + a.tableData[a.rowIdx][3] + '\n' +
    'Col 4:' + a.tableData[a.rowIdx][4] + '\n' +
    'Col 5:' + a.tableData[a.rowIdx][5] + '\n');
    }

    That last column is now undefined, and I no longer have that key value I needed to populate any subsequent tables/charts.

    How can I hide a column from the table, while still retaining the value on the back end?

    Thanks

    Using Pentaho Community edition 4.8.0 and CDE v13.06.05
    Actually I figured it out, I just made sure to set the column type as "hidden" on the component, but now I can't sort by any of the other columns that are properly defined as number...

  5. #5

    Default

    you have to work on the draw paramenter and use something like this:



    var oTable = $('#example').dataTable();

    // Hide the second column after initialisation
    oTable.fnSetColumnVis( 1, false );


    in this way you simply hide the interested column but you can access to it in any moment.

    Hope this can help you

  6. #6
    Join Date
    Apr 2012
    Posts
    17

    Default

    Quote Originally Posted by Duncanmaster View Post
    you have to work on the draw paramenter and use something like this:



    var oTable = $('#example').dataTable();

    // Hide the second column after initialisation
    oTable.fnSetColumnVis( 1, false );


    in this way you simply hide the interested column but you can access to it in any moment.

    Hope this can help you

    So I actually hid the column by specifying it as type "hidden" under column types for the table component.

    But filling in all these different column settings on the table component has caused the sort/order arrows on the column headers to no longer work.

    I'll try it your way and see if I still have that issue.

  7. #7
    Join Date
    Nov 2015
    Posts
    2

    Default

    Hello ,
    I'm using this function on the draw parameter

    $(document).ready(function() {
    var oTable = $('#International_tableTable').dataTable();
    oTable.fnSetColumnVis(0, false);
    });

    And It's not work, My dashboard don't show anything.

    When I try it in the web console, the column was hide.

    What can be the problem??

    ###PROBLEM SOLVED##

    I solve my problem using
    function() {
    $('#' + this.htmlObject + ' .column3').addClass('hidden');
    $('#' + this.htmlObject + ' .column6').addClass('hidden');
    $('#' + this.htmlObject + ' .column9').addClass('hidden');
    $('#' + this.htmlObject + ' .column12').addClass('hidden');
    $('#' + this.htmlObject + ' .column13').addClass('hidden');
    $('#' + this.htmlObject + ' .column14').addClass('hidden');
    $('#' + this.htmlObject + ' .column15').addClass('hidden');
    }
    Last edited by acarrion; 11-11-2015 at 11:56 AM. Reason: Problem solve

  8. #8
    Join Date
    Aug 2017
    Posts
    1

    Default ok , the column is hidden in the page, but not in the excel export

    Quote Originally Posted by acarrion View Post
    Hello ,
    I'm using this function on the draw parameter

    $(document).ready(function() {
    var oTable = $('#International_tableTable').dataTable();
    oTable.fnSetColumnVis(0, false);
    });

    And It's not work, My dashboard don't show anything.

    When I try it in the web console, the column was hide.

    What can be the problem??

    ###PROBLEM SOLVED##

    I solve my problem using
    function() {
    $('#' + this.htmlObject + ' .column3').addClass('hidden');
    $('#' + this.htmlObject + ' .column6').addClass('hidden');
    $('#' + this.htmlObject + ' .column9').addClass('hidden');
    $('#' + this.htmlObject + ' .column12').addClass('hidden');
    $('#' + this.htmlObject + ' .column13').addClass('hidden');
    $('#' + this.htmlObject + ' .column14').addClass('hidden');
    $('#' + this.htmlObject + ' .column15').addClass('hidden');
    }
    ok , the column is hidden in the page, but not in the excel export. How could you do to not have these column in the excel export when I click on the excel button?

  9. #9
    Join Date
    Sep 2017
    Posts
    2

    Default

    Quote Originally Posted by sylguyot View Post
    ok , the column is hidden in the page, but not in the excel export. How could you do to not have these column in the excel export when I click on the excel button?
    I need this, please.

Tags for this Thread

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.