I'm a new user of pqGrid...so far so good! I'm using inline editing and I do have a question regarding interdependent dropdowns (i.e. interdependent 'select' column editors). For example, I have a 'country' column using a 'select' type editor containing a list of valid countries (i.e. "name"). Predictably, I would then like to have a 'region' column whose valid select options are dependent on the country that has been chosen. Currently, I'm referencing an array of JSON countryRegion objects (example entries shown below) to populate the country select options, and hopefully the corresponding region dropdown options as well.
myJSNamespace.countryRegions = [
{name: "Canada", id:"CA", regions:"Alberta|British Columbia|Manitoba|New Brunswick|Newfoundland|Northwest Territories|Nova Scotia|Nunavut|Ontario|Prince Edward Island|Quebec|Saskatchewan|Yukon Territory"},
{name: "Virgin Islands, U.S.",id:"VI",regions:"St. Thomas|St. John|St. Croix"}
]
How would one best accomplish this desired functionality? FYI, here are the correspoding colModel entries as they stand (with working country select editor, but no interdependent region select):
var colModel = [
{
title: "country",
width: 150,
dataType: "string",
dataIndx: "country",
editor: {
type: "select",
options: myJSNamespace.countryRegions,
mapIndices: {name: "country"},
labelIndx: "name",
valueIndx: "name"
}
},
{
title: "region",
width: 150,
dataType: "string",
dataIndx: "region"
},
]