is it possible to use a dependent dropdown in Lightbox? See: http://demos.krajee.com/widget-details/depdrop
Asked
Active
Viewed 655 times
1 Answers
0
Lightbox API allows you defining custom controls, so you should be able to create a lightbox wrapper for jQuery dependent dropdown.
Here is related docs article: https://docs.dhtmlx.com/scheduler/custom_lightbox_editor.html
Also, there is a working example if dependent dropdowns implemented in plain js/html in scheduler samples package:
https://docs.dhtmlx.com/scheduler/samples/02_customization/26_linked_selects_in_lightbox.html

Alex Klimenkov
- 956
- 1
- 5
- 8
-
Can I transform the selects to `Jquery` `select2` fields? Or to `autocomplete combobox`? – ps202 Jan 11 '19 at 14:20
-
I'd try implementing it with jquery select2, though. I think it'll be more flexible than the built-in combo. You'll have to wrap jquery control into a custom lightbox control. Here are small examples with jquery chosen http://snippet.dhtmlx.com/f4f83b015 and jquery select2 http://snippet.dhtmlx.com/a755f4ebe In order to make a dependent control from it, you'll need to add two such controls to the lightbox (sample http://snippet.dhtmlx.com/88168a426), then listen to onchange event of the top dropdown and update options of the bottom dropdown based on parent selection – Alex Klimenkov Jan 11 '19 at 14:38
-
Thanks Alex, very helpful! The examples are always with `multiselect`. Is there a way to disable `multiselect`? – ps202 Jan 11 '19 at 15:45
-
You can change it in `form_blocks[...].render` method, just remove `multiple` attribute from select element html: http://snippet.dhtmlx.com/c79bddcc8 – Alex Klimenkov Jan 12 '19 at 21:47
-
Thanks Alex... I am fighting now with `optionsconnector` and `yii2`. Can you have a look on this topic? [https://stackoverflow.com/questions/54150808/yii2-with-dhtmlx-scheduler-and-select-populated-from-the-server] – ps202 Jan 12 '19 at 23:04
-
sure, I've posted an answer there. Not sure how helpful it is, tbh, I've never worked with yii2 framework – Alex Klimenkov Jan 14 '19 at 13:58