I have implemented dependent dropdowns in jqGrid (similar to this example). The row data returned has values as well as display values. How can I show display values on grid rows? At grid initialization time I do not have list of values for dependent dropdowns, they get loaded from the server when user selects value from other dropdown. formatter: 'select'
helps when I know the values of dependent dropdown but I am not sure how to use it when the values are loaded dynamically.
How to: jqGrid dependent select box display values in rows
Asked Answered
In case of loading the data from the server you need just set editoptions.value
or formatoptions.value
before formatter: "select"
start to process the data. You can use beforeProcessing
callback for example. It will be called at the moment which you need. You can place the information with editoptions.value
in userdata
part of the server response or in any other place. The data
parameter (the first parameter) of beforeProcessing
callback contains all the data from the server response. So you can easy get the required data and to use setColProp
for example to change the options used by formatter: "select"
. I recommend you to read the answer for the corresponding code example.
© 2022 - 2024 — McMap. All rights reserved.