>>Is it possible to use ‘hidden’ columns? (still using the convert option) The PRO version of grid supports grid.setColumnHidden command. So you can convert existing table to the grid and hide necessary columns after that.
>>will I be able to read all the data from the cells and save them to the database? Since I’m not using an XML-file… The API of grid works the same for all ways of initialization, so all existing data access API will work in case of init from HTML.
The “onbeforeinit” occurs before the grid has been made, so the call to “set_combo” doesn’t work, because the function contains “mygrid”, which hasn’t been initialized yet…
But I’ve altered the code into the following:
Id
employeename
#id#
#employeename#
This gives me a combobox in the grid, it’s not quite the same as the dhtlmxCombo on my other screens, but it almost suffices. There are still a few strange things though: - the employeename, which was first added to the table, is added to the bottom of the list, instead of selecting the one from the list. - The combo is case sensitive, this is not a serious problem, but it’s not consistent with the rest - I’m able to input anything, even if not in the selection list and leave the cell without having a valid option. I fixed this with the normal dhtmlxCombo by using this : if (combo.getActualValue()==combo.getComboText()) //non existing option entered { form.combostatus.value=‘Reset’; combo.setComboValue("#form.employeeid#"); } else if (form.combostatus.value == ‘Reset’) { frmProject.combostatus.value=’’; } But this doesn’t apply here…
Now I’ve still have to focus on how that API works, I’ve still got no clue on how to get all the griddata and save it back to the database…
because the function contains “mygrid”, which hasn’t been initialized yet… yes, was a my typo, the correct code will be function set_combo(){ var combo = datagrid.getCombo(2); while “mygrid” is still not created you can use id of souce table (“datagrid” in you case ) as reference for grid object.
>>- the employeename, which was first added to the table, is added to the bottom of the list, instead of selecting the one from the list.
#employeename#
- here you need to use ID, not combo ( to work correctly it requires to call set_combo from before_init as well )
- value/label pairs loaded during grid init ( onbeforeinit) - grid loads data from table and convert values to labels ( ID to name)
>>- I’m able to input anything, even if not in the selection list and leave the cell without having a valid option Change column type to mygrid.setColTypes("ed,ed,coro
>>This gives me a combobox in the grid, it’s not quite the same as the dhtlmxCombo Actually it is not the dhtmlxCombo, it is a “co” column type - built in combo of dhtmlxGrid To have real combo in grid, you need to use column type “combo”, getCellCombo instead of getCombo, and addOption instead of put method
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan