setHeader not working with HTML Table init?

Hello everyone,

I’d like to instantiate dhtmlxGrid from a HTML Table but did not succeed to put filters in the header column by attachHeader. I’m doubting even setHeader is not working there.

How can I add a custom filter in the header row?

Thanks!

Actually, the Problem is if I call init() I have the filter and the headers, but the data is gone… :frowning:

There is no need to call the init() method in case of initilization from the html table.
Please, refer to the following code sample:

[code]

















Column 1 Column 2
11 112.5
11 14.15
11 85

[/code]

@sematik

Thank you for the above, I was having the same problem. I have a follow-up question: My #combo_filters do not populate with data from their columns, they are just blank.

Following the example, I do not see any properties I may be missing.

Script:
mygrid = new dhtmlXGridFromTable(‘tblToGrid’);
function doBeforeInit( { grid1.attachHeader("#text_filter,#text_filter,#combo_filter,#combo_filter");}

Is there something I need to do after init to populate these combos?

Please, try to call refreshFilters() method after the init of the grid:

[code]//add “oninit” event

...