0

jqGrid.js v5.3.2

Hi all, I have been trying to figure out a way for 10 hrs for below situation:

  1. the grid is set to inline edit.
    1. there are two dropdown/selects. ddl1 and ddl2
    2. the options list of ddl2 depends on the value of ddl1. This means each row may have different options.
    3. I have been able to dynamically populate/select/save ddl2 based on ddl2's initial Key value or the selected value of ddl1 during Editing by setting dataUrl of ddl2 and "change" of dataEvents on ddl1 (column).
    4. I want to display the Value(not the Key) of ddl2 initially. is there a way I can set a row's "formatter"'s "value" property dynamically in loadComplete? I forcefully set the html content of the "td"/cell during loadComplete but the content wont survive a round of Edit/Restore.

TIA

Sean Ad
  • 85
  • 11
  • Look at [the old answer](https://stackoverflow.com/a/4480184/315935), which describes an implementation for an old version of jqGrid. – Oleg Mar 24 '20 at 22:38
  • In the demo site of [Guriddo](http://www.guriddo.net/demo/guriddojs/) there is a demo for form editing - click on editing tab. I have prepared a demo for inline one too. [Look here](http://www.guriddo.net/demo/guriddojs/edit_add_delete/inline_depend_dropdown/) – Tony Tomov Mar 25 '20 at 04:38
  • Oleg's solution of using editoptions.value has a problem of load all options before the grid is constructed, if the full options too large(possible). Tony's solution uses the string Value(not the Key) as the initial input will have issue(solvable) when saving back while a Key is expected and no change on the select, I think. But I eventually take the editoptions.value approach to save me a little bit of time. Thank you guys. – Sean Ad Mar 25 '20 at 13:05

0 Answers0