Expand/Collapse in the dthmlx grid not working

I am using professional edition of dhtmlx with ruby on rails platform. I am setting my grid header like the following below,

grid.setHeader("No,PR No,Material,#cspan,{#collapse}1:UoM,Quantity,Currency,Basic Price,Required Date,Discount,#cspan,Taxes,#cspan,#cspan,Net Price ");

grid.attachHeader("#rspan,#rspan,Code,Description,#rspan,#rspan,#rspan,#rspan,#rspan,%,Amount,ED,ST,Tax N,#rspan");

I am not able to expand/collapse the column headers.If i use {#collapse}1 it will work only for that specified column.I went through the documentation also,but not able to solve it.I have included dhtlmx_hextra.js file also.What exactly is grid.collapseColumns(3)? what parameter should we pass for this function.Help me.Its urgent.


How much columns do you want to collapse? If you want collapse all columns till the end, you should use:

Thanks for the reply. I want to collapse the next 3 columns from the UoM column i.e., Quantity,Currency,Basic Price.When i click on UoM,these 3 columns should be able to expand/collapse.As per the documentation have used grid.collapseColumns after grid.int() function.Still not working.Is there any dependency file to be included other than dhtlmx_hextra.js to make it work? I am able to get ‘-’ minus symbol in the column where i have included the collapse.But not able to toggle it to ‘+’.

First parameter of collapseColumns() method id index of column, which should be collapsed. So in your case you should use:


Sorry.Still not working.Have included the same way you have been told.