Categories | Question details Back To List | ||
Grid Auto Size in div Hi, I have the following xml. I have couple of issue. 1. in the column tag if i say allign=center then the data gets center alligned but the header is not center alligned, I want the data allign right and header align center. 2. I have the following div in to which the below grid is loding <div id="gridbox" style="width:auto;height:178px"></div> I want the grid to auto size ie the hight should use the full div size if the data is less if the data is more it should size the div according. <?xml version="1.0" encoding="UTF-8"?> <rows> <head> <column width="6.5" type="ro" align="left" ></column> <column width="6.5" type="ro" align="right" >Goal</column> <column width="6.5" type="ro" align="right" >Commit</column> <column width="6.5" type="ro" align="right" >Actual</column> <column width="6.5" type="ro" align="right" >To Go</column> <column width="6.5" type="ro" align="right" >#cspan</column> <column width="6.5" type="ro" align="right" >Forecastable Funnel (stage 2 to 5)</column> <column width="6.5" type="ro" align="right" >Total Funnel vs To Go</column> <column width="6.5" type="ro" align="right" >#cspan</column> <column width="6.5" type="ro" align="right" >Forecast Status</column> <column width="6.5" type="ro" align="right" >#cspan</column> <column width="6.5" type="ro" align="right" >Opportunity Stage</column> <column width="6.5" type="ro" align="right" >#cspan</column> <column width="6.5" type="ro" align="right" >#cspan</column> <column width="6.5" type="ro" align="right" >#cspan</column> <column width="6.5" type="ro" align="right" >#cspan</column> <afterInit> <call command="attachHeader"><param>#rspan,#rspan,#rspan,#rspan,Goal,Commit,#rspan,Goal%,Commit%,Commit,Upside,1-Prospect,2-Qualification,3-Proposal,4-Agreement,5-Closing</param></call> </afterInit> <settings> <colwidth>%</colwidth> </settings> </head> <row id="1"> <cell style="font-weight:bold;" >Current Year</cell> <cell>12587</cell> <cell>9960</cell> <cell>981</cell> <cell>11606</cell> <cell>8979</cell> <cell>3445</cell> <cell>30%</cell> <cell>38%</cell> <cell>1882</cell> <cell>1563</cell> <cell>654</cell> <cell>1042</cell> <cell>1361</cell> <cell>1028</cell> <cell>14</cell> </row> <row id="2"> <cell style="font-weight:bold;" ></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell>16%</cell> <cell>25%</cell> <cell>33%</cell> <cell>25%</cell> <cell>0%</cell> </row> <row id="3"> <cell style="font-weight:bold;" >Previous Year</cell> <cell>9768</cell> <cell>8964</cell> <cell>686.7</cell> <cell>9081.3</cell> <cell>8277.3</cell> <cell>2928.25</cell> <cell>32%</cell> <cell>35%</cell> <cell>1599.7</cell> <cell>1328.55</cell> <cell>555.9</cell> <cell>625.2</cell> <cell>1156.85</cell> <cell>715.6</cell> <cell>11.9</cell> </row> <row id="4"> <cell style="font-weight:bold;" ></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell>18%</cell> <cell>20%</cell> <cell>38%</cell> <cell>23%</cell> <cell>0%</cell> </row> <row id="5"> <cell style="font-weight:bold;" >Delta</cell> <cell>2819</cell> <cell>996</cell> <cell>294.3</cell> <cell>2524.7</cell> <cell>701.7</cell> <cell>516.75</cell> <cell>-3%</cell> <cell>+3%</cell> <cell>282.3</cell> <cell>234.45</cell> <cell>98.1</cell> <cell>416.8</cell> <cell>204.15</cell> <cell>308.4</cell> <cell>2.1</cell> </row> </rows> ------------- Thanks Joe Answer posted by dhxSupport on Dec 07, 2009 01:31 1. You can use 3rd parameter of setHeader() method. mygrid.setHeader("A,B,C",null,["text-align:right;","text-align:left;","text-align:center"]); There is no way to set header alignment from xml 2. You can use auto height mode. http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxgrid:api_method_dhtmlxgridobject_enableautoheight |