Invalid Argument

Hi,



I am using dhtmlx v1.5 build 80319.

I am facing a js error (Invalid Argument) while dynamically inserting a column to a dhtmlx grid.



For your ref, the piece of code is as follows,

------------------------------------------------------



mygrid = new dhtmlXGridObject(gridTarget);                    

mygrid.imgURL = “<%=appName%>/images/”;

mygrid.setHeader(‘Pay Category,Total Hrs,Total Cost’);

mygrid.attachHeader(’#rspan,#rspan,#rspan’);

mygrid.setInitWidthsP(’*,5,5’);                    

                        mygrid.setSkin(“light”);                                                                         

mygrid.setColAlign(‘left,right,right’);

mygrid.setColSorting(‘na,na,na’);

mygrid.setColTypes(‘ro,ro,ro’);

mygrid.enableAutoHeigth(true);

mygrid.enableColumnAutoSize(false);

mygrid.init();

                        

mygrid.insertColumn(mygrid_<%=unitIdKey%>.getColumnsNum()+1,‘Dept Name’,‘ro’,‘10’,‘na’,‘right’,‘right’,false,‘white’);



------------------------------------------------



Can you pls help me fix this



Thank you in advance,



Madhu

You are using “right” value for “vertical align” parameter, which is not correct value ( cause error in IE )
replace it with empty string or correct value ( top, bottom, etc. )

Hi,

I have changed the vAlign param to ‘top’ and also to ‘’ .
Still it is showing the error. (Invalid Argument)

                        mygrid_<%=unitIdKey%> = new dhtmlXGridObject(gridTarget);                   
                        mygrid_<%=unitIdKey%>.imgURL = “<%=appName%>/images/”;
                        mygrid_<%=unitIdKey%>.setHeader(‘Pay Category,Total Hrs,Total Cost’);
                        mygrid_<%=unitIdKey%>.attachHeader(’#rspan,#rspan,#rspan’);
                        mygrid_<%=unitIdKey%>.setInitWidthsP(’*,5,5’);                   
                        mygrid_<%=unitIdKey%>.setSkin(“light”);                                                                              
                        mygrid_<%=unitIdKey%>.setColAlign(‘left,right,right’);
                        mygrid_<%=unitIdKey%>.setColSorting(‘na,na,na’);
                        mygrid_<%=unitIdKey%>.setColTypes(‘ro,ro,ro’);
                        mygrid_<%=unitIdKey%>.enableAutoHeigth(true);
                        mygrid_<%=unitIdKey%>.enableColumnAutoSize(false);
                        mygrid_<%=unitIdKey%>.init();                
      
                        mygrid_<%=unitIdKey%>.insertColumn(mygrid_<%=unitIdKey%>.getColumnsNum()+1,‘Dept Name’,‘ro’,‘10’,‘na’,‘right’,‘top’,false,‘white’);

The modified code is given above, with the last line of code changed.
Here I am using mygrid_<%=unitIdKey%>, as I have to create multiple grids based on the different keys.

Awaiting your reply,

Thanks,
Madhu


The same code works correctly in local tests - please check sample ( sent by email )


If problem still occurs for you - try to use dhtmlxgrid_mcol.js from sample.

Hi,

I have tried it, but its giving the same error.

The below piece of code works fine in Firefox. Also when I create a new jsp and add this code this is perfectly working fine(both in IE and Firefox).
But in my application’s jsp page which has other grids in the same page though with different grid names, this error is coming again and again. (with Firefox no problem)
I have included
This is the piece of code.













body…


           

                   
                   
       

Please help me thru this…

Thanx in advance,

With regards,

Madhu

payResults.jsp (8.9 KB)


In case of IE problem can be caused by complex HTML layout. Cells in such layout will have height settings only when table tag already closed, untill that time cell have not height, and because of that grid can’t be init. Calling insertColumn command against such collumn cause an error.


You can
a) run init code from onload handler
b) move js part of code below table tag