PDA

View Full Version : Combobox not showing displayField values



rparsons
Dec 19, 2022, 2:51 PM
I'm having an issue showing data in my combobox. It loads the data but doesn't display the displayField value for selecting. Instead I just see the correct number of lines as 2 pixel high blanks when I drop the combobox down. Any help would be appreciated.


<ext-comboBox fieldLabel="Org" labelWidth="50" padding="3" displayField="Name" valueField="Id">
<listeners>
<select handler="alert('hello world');" />
</listeners>
<store>
<ext-store autoLoad="true">
<proxy>
<ext-ajaxProxy url="@Url.Action("GetOrgs", "Header")"/>
</proxy>
<fields>
<ext-integerDataField name="Id" />
<ext-stringDataField name="Name" />
</fields>
</ext-store>
</store>
</ext-comboBox>

rparsons
Dec 19, 2022, 3:26 PM
The fix was to simply change displayField from "Name" to "name".

Anyone know why this works, and why "Name" wouldn't work?

bbros
Jan 03, 2023, 12:17 AM
I think it's a problem of converting field names into properties of classes managed in JavaScript, which have a naming convention that forces you to have a lowercase initial.
I confirm that I have always treated the fields with the initial lowercase to avoid the problem you reported.