trai bui
trai bui

Reputation: 598

Datatable in Pentaho CDE

I'm trying to do datatables in pentaho cde. In pentaho the name of component is Table Component.

The problems is where I try to do a dynamic query with a no specific number of columns, and the following error occurs:

DataTables warning (table id = 'datosTable'): Added data (size 5) does not match known number of columns (3).

Upvotes: 3

Views: 2087

Answers (2)

fmh
fmh

Reputation: 56

You have to let DataTables redefine the structure, for that you either have to provide an empty definition of colHeaders / colTypes / colFormats or provide the correct format definitions.

A few days ago i encountered a big problem which i could not really debug with the table component, my solution for any problems with the table component is now: 1) replace table component with query component, 2) define an table in html within the post execution function of the query component 3) grab the table with jQuery and .dataTable() it your own way.

this is in my opinion a good way for complex table solutions and minimizes the chances to mess up everything at the table component settings - if you can handle dataTables :D

Upvotes: 1

user2129022
user2129022

Reputation:

It's seem you want your table must change with query, put this function into Pre Execute

function f() {
        this.chartDefinition.colHeaders = [];
        this.chartDefinition.colTypes = [];
        this.chartDefinition.colFormats = [];        
}

Upvotes: 3

Related Questions