ParamQuery grid support forum
General Category => ParamQuery Pro Evaluation Support => Topic started by: daverene on April 05, 2017, 04:10:10 am
-
I have a select box in a row which needs to be filled with data depending on what value another record has in the same row. I have the following colModel for this field and it does not appear to work.
title: "Event", dataType: "string", dataIndx: "Event", minWidth: 70, maxWidth: 70, hidden: false, editable: function (ui) { if (ui.rowData.Update == 1) { return true; } else { return false; } },
filter: {
type: "select",
condition: 'equal',
prepend: { '': '-ALL-' },
valueIndx: "Event",
labelIndx: "Event",
listeners: ['change']
},
editor: {
type: 'select',
valueIndx: "EventNo",
labelIndx: "EventNo",
options: function (ui) {
var grid = this,
column;
$.getJSON("http://projectcontrols/TimeLinkWebservice/TimeLinkWebservice.asmx/JSON_GetEvents?WorkOrderNo=" + ui.rowData.WorkOrderNumber, function (response) {
column = grid.getColumn({ dataIndx: 'Event' });
column.editor.options = response;
});
}
}
-
my url returns the following data
[{"ID":0,"EventNo":""},{"ID":71,"EventNo":"34"},{"ID":259,"EventNo":"54"},{"ID":262,"EventNo":"57"},{"ID":264,"EventNo":"59"},{"ID":265,"EventNo":"60"},{"ID":266,"EventNo":"60"},{"ID":10396,"EventNo":"74"}]
why would this not appear in the select editor? How to I insert this into the sell correctly?
-
Do you have an answer on how to make a select fill depending an what another record is in the same row?
-
editor options is a synchronous method, it can't be used to make async calls.
I would suggest to cache all the options data and return options synchronously similar to this example:
https://paramquery.com/pro/demos/cascade_select