Categories | Question details Back To List | ||
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? Answer posted by Support on Jun 09, 2008 05:15 >>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 http://www.dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Combo_excell.html#grid_art_comboexcell If you still want to load combo from event - getCombo method returns option collection for co|coro excell , it can't be used with dhtmlxCombo - dhtmlxCombo doesn't support loading from JSON, currently it can be loaded from XML only, you can reffer to dhtmlxCombo API http://www.dhtmlx.com/docs/products/dhtmlxCombo/doc/guide.html#combo_adding_options http://www.dhtmlx.com/docs/products/dhtmlxCombo/doc/alpha.html#combo_api_a Answer posted on Jun 09, 2008 06:29 >>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 can configure the combo to work in autocomplete mode without using onEditCell event 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);) and load from my XML datasource (combo.loadXML(url,callback);) and finally enable the filtering mode (combo.enableFilteingMode(true);) Or am I wrong? Answer posted by David on Jun 10, 2008 02:20 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! Answer posted by Support on Jun 10, 2008 03:38 >>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. http://www.dhtmlx.com/docs/products/dhtmlxGrid/samples/interaction_other_components/pro_linked_grid.html?un=1213095353000 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 ) |