Grid with autocomplete ComboBox

I’m having a hard time setting up the needed comboboxes for my grid.



In my setColTypes I defined a “combo” type. I attached the onEditCell Event and in the function itself I did nothing more than this:



function onEditCell(stage, id, index)

{

var ind = mygrid.getRowIndex(id);

if(index == 2 && stage == 0)

{



}

return true;

}



Now, when I edit the specific cell through dbl click, there pops up a div at the very top of the page containing plain “false” written into it. Also the the ComboBox in the grid doesn’t ssem to fit when in edit mode.



I certainly did not insert this div… so where does it come from?



And while at it… if I wanted to use the combobox in autocomplete mode, it should look like this:



function onEditCell(stage, id, index)

{

var ind = mygrid.getRowIndex(id);

if(index == 2 && stage == 0)

{

var combo = mygrid.getCombo(2);

combo.load(‘data.ashx’,‘JSON’);

}

return true;

}



am I right?

there pops up a div at the very top of the page containing plain "false"
Which version of dhtmlxcombo are you using? The same problem really was exist in one of earlier build, but must not occurs with latest code.

>>And while at it… if I wanted to use the combobox in autocomplete mode
You can configure the combo to work in autocomplete mode without using onEditCell event
    dhtmlx.com/docs/products/dht … ombo_api_a


>>Which version of dhtmlxcombo are you using? The same problem really was exist in one of earlier build, but must not occurs with latest code.
you were right, indeed I attached a older js version to the page. After updating all references the error did not occur anymore -> solved :slight_smile:



>>You can configure the combo to work in autocomplete mode without using onEditCell event
    dhtmlx.com/docs/products/dht … omboexcell
I did see this before and I don’t think I can use this approach. My grid is getting it’s data from JSON through webservices. A XML approach is not possible this way I think.



Using dhtmlXCombo would be really nice. I think there will be no big problem for me to write a XML DataSource as webservice to load with “loadXML”, but still I would prefer JSON. Is this planned for dhtmlXCombo in the near future?



So practically in my case there would be no other than using the onEditCell event, grad the dhtmlXCombo (combo = grid.getCellCombo(column_index):wink: and load from my XML datasource (combo.loadXML(url,callback):wink: and finally enable the filtering mode (combo.enableFilteingMode(true):wink:



Or am I wrong?


Just want to let you know, that my implementation of a xml datawebservice works just fine.



Are you planning to release a combobox which supports a “normal” dropdown behaviour and loads data dynamically on demand? Like your grid in SRND mode…



Would be such a killing feature!

So practically in my case there would be no other than using the onEditCell event
Yes, it is a correct approach.

>>which supports a “normal” dropdown behaviour and loads data dynamically on demand
Sound as interesting idea , we will add it to our plans.
By the way you can implement something similar with current functionality - you can use grid as editor for different grid.
    dhtmlx.com/docs/products/dht … 3095353000
The grid used as editor can work in SRND mode - so basically you will have very similar use-case ( not so slick, but may be useful )