Index.razor
public int? Keys { get; set; }
|
<EjsInPlaceEditor @ref="@edtFamilyId" @ref:suppressField
Name="FamilyId"
TValue="string"
Type="InputType.ComboBox"
EmptyText="@InitialEmptyText"
Model="@FamilyModel">
<InPlaceEditorEvents TValue="string" OnActionBegin="OnActionBegin" OnActionSuccess="OnActionSuccess" />
</EjsInPlaceEditor>
private static List<DataModel> ComboData = new List<DataModel>() {
new DataModel { Keys = 0, Name = "-" },
new DataModel { Keys = 1, Name = "Adams" },
new DataModel { Keys = 2, Name = "Brown" },
new DataModel { Keys = 3, Name = "Smith" },
new DataModel { Keys = 4, Name = "Jones" }
};
public static Person person = new Person() { FamilyId = 2 };
public string InitialEmptyText = (ComboData.Where(i => i.Keys.Equals(person.FamilyId)).FirstOrDefault()).Name;
private object FirstNameModel = new { placeholder = "Enter the name" };
private object FamilyModel = new
{
placeholder = "Select value",
dataSource = ComboData,
fields = new ComboBoxFieldSettings() { Text = "Name", Value = "Keys" },
value = person.FamilyId
};
|