Set max column size after splitat

Hi,



I’m having a grid. the column size is “100”. I’ve applied the splitat “splitAt(1)” funcionality to it. i’ve specified the width of the grid to “500”. In the 'Grid there are “5” columns.



When i drag the size of the first column that was splitted and is having the disabled scroll bar to the maximum size of the grid, all the other four columns are moving to the right and are not visible.



I want the grid size also to expand accordingly when i drag the splitted column (i.e. first column). In the discussions from the forum it is learnt that ‘enableAutoWidth’ and ‘splitAt’ are incompatible at certain conditions.



Is it possible to set the maximum column size for the splitted row beyond, So that it cannot be dragged beyond that size?

or

Is there any alternate solution?



Could you please suggest me on how to acheive this functionality?

The same behavior can be mimic by using onResizeEnd event

    var init_width=50;
    mygrid.attachEvent(“onResizeEnd”,function(){
        var delta=this.getColWidth(0)-init_width;
        var box=document.getElementById(‘gridbox’);
        box.style.width=box.offsetWidth+delta+“px”;
        this._fake._correctSplit();
        init_width+=delta;
    })

1209114387.ZIP (1.71 KB)


Thanks for the quick reply.



 I was not able to get the solution for the problem even after adding the method suggested by you.



The problem can be reproduced even in the sample programs for ‘SplitAt’ functionality. In the sample program the grid is split at column 2 (SplitAt(2)). So, drag the column size of the second column to the size of the grid. the grid will be left with only two column that are being displayed. The other columns of the grid would have moved right and will not be visible.



I want the columns that are splitted to be resized but not to the size of the grid and cause the problem. Please do suggest a solution on ow to acheive the required functionality.

The code above was written for situation with single splitted column in case of two columns in split, the code will look as

    var init_width=50;
    mygrid.attachEvent(“onResizeEnd”,function(){
        var delta=this.getColWidth(1)-init_width;

Did you check the sample attached to previous post, it shows the grid in split which increase|decrease its size when split area resized
With change in code mentioned above it will work for splitAt(2) as well.


Hi,



In the attachment that was sent the grid was not getting loaded. I tried the code of yours that was sent earlier and later for one column split and two column split respectively but the functionality was not happening. I was able to drag the splitted column to the size of the grid. Could you please suggest me on where to place the code? I had placed the code before calling “grid.init();”. I have called the ‘splitat’ functionality in the XML in the settings.

Actually the code can be placed in any place ( it just attach event handler, so it not critical to timing )
If problem still occurs for you - please contact us directly at support@dhtmlx.com


Hi,



Thanks for the solution. It works fine.



Is it a permanent solution or a work around solution for the problem.?



I want to know whether this functionality will be implemented in the future build?

Exactly same code will not be included in next version of the grid, but next version of the grid ( release planed on next week ) will support usage of splitAt and enableAutoWidth in same time ( which will resolve original issue )


Hi,



Has this functionality been implemented? If yes in which build has it been implemented?

dhtmlxGrid 1.6 ( starting from build 80512 ) supports usage of splitAt and enableAutoWidth in same time.