I am creating a grid with a dropdown (select) populated by editoptions{dataUrl:’myUrl’}. The issue I am having is I need to disable this dropdown (or alternatively, remove it from the edit form and in its place add the Column Name: Value in text format). I only want to disable this in the edit form though.
I’ve tried the afterShowForm event, but that doesn’t work because afterShowForm is fired before the data is fetched from the dataUrl.
The dataInit option for editoptions seems like it would be convoluted to manipulate correctly, as it needs to occur for just edits, and not adds (need to change the functions somehow).
What other methods are there?
Inside of beforeInitData you can make any modification of
colModel. You can either use setColProp method or just get the reference to internalcolModelparameter withgetGridParamand do any modifications which you need directly. For example you can deletedataUrlfromeditoptionsof some column or just changeedittypeto fromselectto default valuetext. You can do different actions for Edit and Add forms. I recommend you use recreateForm: true to be sure that you always work with new form.