Author Topic: Populate Select Box options using ajax call on CLICK or Tab OUT CELL  (Read 1818 times)

cijojohn

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 73
    • View Profile
Hi Team,

we want to populate options in select box when user clicks on it or using tab out. The options in select box are dynamic. (depends on other cell values present in the same row). We tried late binding demo but it doesn't helped us.

Could you please share the jsFiddle for the same? (let's say every time user clicks on cell it should populate the options from ajax call)
« Last Edit: September 06, 2017, 09:06:43 pm by cijojohn »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Populate Select Box options using ajax call on CLICK or Tab OUT CELL
« Reply #1 on: September 06, 2017, 11:08:46 pm »
This example of cascading select lists https://paramquery.com/pro/demos/dependent-date-editors is more relevant to your use case.
Please note that the remote request should be synchronous.

Code: [Select]
{ dataIndx: "region", title: "Region", width: 200,
                editor: {
                    type: "select",
                    prepend: { "": "" },
                    options: function (ui) {
                        //make synchronous call to the server to get options depending upon values in ui.rowData   
                        return options;
                    }
                }
            },