OK, I have an editor form for a record in a datasource. There is a foreign key in the record that calls out to another table. To represent the legal values, we are using a dropdown list in the form, populated by a datasource that represents the foreign table. The HTML looks like this (names have been changed):
This is working FINE, and populates the dropdown with the required values. However, I need to be able to support null values in record.Other_Id. Right now, if record.Other_Id is null, it instead sets it to the first value in otherDataSource. That's not cool.
Is there some (ANY!) way for me to get this thing to provide a null option for cases in which record.Other_Id is null?
Thanks for your time!
Tess
<
select
data-role
=
"dropdownlist"
data-value-field
=
"Other_Id"
data-text-field
=
"Name"
data-bind
=
"source: otherDataSource, value: record.Other_Id"
></
select
>
This is working FINE, and populates the dropdown with the required values. However, I need to be able to support null values in record.Other_Id. Right now, if record.Other_Id is null, it instead sets it to the first value in otherDataSource. That's not cool.
Is there some (ANY!) way for me to get this thing to provide a null option for cases in which record.Other_Id is null?
Thanks for your time!
Tess