Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by DJay on Dec 02, 2009 12:38
open dhtmlx forum
How can I show the dhtmlxCombo on load of dhtmlxGrid without letting user to double click on the grid cell

I am using dhtmlxGrid with dhtmlxCombo. Currently when I double click the grid cell then the dhtmlxCombo shows up and then there I can chage the values

How can I show the dhtmlxCombo on load of dhtmlxGrid without letting user to double click on the grid cell?

 

Answer posted by Alex (support) on Dec 03, 2009 01:50

The latest combo excell version provides combo_v type (you can use it instead of combo). This excell allows to show arrow image initiaally for each combo cell.

Moreover you can change edit events. Grid allows to edit cells on click: http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxgrid:api_method_dhtmlxgridobject_enableeditevents

grid.enableEditEvents(true,true,true);

Answer posted by DJay on Dec 03, 2009 07:10

 

After changing column type to  combo_v excell shows the arrow image and setting proerty grid.enableEditEvents(true,true,true);,makes is editable on click.

But now, when I click on the combo, it shows only one option in the combo and does not show rest of the options. I am loading the grid via XML as below

<?xml version="1.0" encoding="UTF-8"?>
<rows>
  <head>
  <column width="20" type="ro" align="left" sort="str">Wire Code</column>
  <column width="20" type="ro" align="left" sort="str">Org. Name</column>
  
  <column width="20" type="combo_v" editable="false" source="" align="left" sort="str" >Status 
      <option value="IN USE">IN USE</option>
      <option value="AVAILABLE">AVAILABLE</option>
       <option value="CLEANSING">CLEANSING</option>
      <option value="RESTRICTED (DO NOT USE)">RESTRICTED (DO NOT USE)</option>
   </column>

  <column width="20" format="%m/%d/%Y" type="dhxCalendar" align="left" sort="str"  >Effective Date</column>
  <column width="20" type="link" align="left" sort="str">Action</column>

 <settings>
     <colwidth>%</colwidth>
 </settings>
       
    </head>

  <row id="1001">
  <cell>KB</cell>
  <cell>Manchester, NH</cell>
  <cell>IN USE</cell>
  <cell>05/01/1998</cell>
  <cell>History^javascript:alert("history");^_self</cell>
 </row>
 <row id="1002">
  <cell>AY</cell>
  <cell>ADMIN DIVISION</cell>
  <cell>IN USE</cell>
  <cell>01/01/2000</cell>
  <cell>History^javascript:alert(1);^_self</cell>
 </row>
 <row id="1003" >
  <cell>AQ</cell>
  <cell>AKRON</cell>
  <cell>AVAILABLE</cell>
  <cell>06/01/2006</cell>
  <cell>History^javascript:alert(1);^_self</cell>
 </row>
<rows> 

 

 

Thank you.  

Answer posted by Alex (support) on Dec 03, 2009 08:03

try to use

 <column width="20" type="combo_v" editable="false" align="left" sort="str" xmlcontent="1">Status

instead of

 <column width="20" type="combo_v" editable="false" source="" align="left" sort="str" >Status  

Answer posted on Dec 03, 2009 08:08

Ohhh OK....so xmlcontent="1" is the key here.

Now it works as I expetected. Thanks for your help.