I have a Dialog with 4 fields, the first 3 are cascading dropdowns and the 4th is a free entry field
If the user selects an item from the first dropdown, the next two dropdowns are populating and showing values but if the user clicks straight to the 4th field, then nothing has been selected these two fields. In this case I want the 1st item in the 2nd and 3rd dropdowns to be selected automatically
Here's the code for the 2nd field where I've been playing around unsuccessfully with the dataBound and 'this.select' lines following suggestions on this forums but the 'this' doesn't appear to be populated
function cascadeComponentDropDownEditor(container, options) {
$('<input id="componentDDL" disabled data-bind="value:' + options.field + '"/>')
.appendTo(container)
.svDropDownList({
autoBind: false,
dataTextField: "Name",
dataValueField: "Id",
select: onComponentSelect,
dataSource: {
type: "json",
transport: {
read: componentDropdownUrl
}
},
dataBound: function() {
if (this.dataSource.total() > 0)
this.select(0);
}
}).data("svDropDownList");
}