PDA

View Full Version : [CLOSED] Combobox Display field not showing inside grid panel



matrixwebtech
Jun 26, 2014, 8:15 PM
@( Html.X().Store()
.ID("stormaterialid")

.Model(
Html.X().Model()
.IDProperty("MaterialID")
.Fields(
Html.X().ModelField().Name("MaterialID").Type(ModelFieldType.Int),
Html.X().ModelField().Name("MaterialName").Type(ModelFieldType.String)

)


)
.ServerProxy(X.AjaxProxy()
.Url(Url.Action("Pur_MaterialInformation_Get", "MaterialRequisitionsEntry"))
.Reader(X.JsonReader().Root("data"))
)

)









Html.X().GridPanel().ColSpan(4)
.ID("gridpanel")
.Width(600)
.Height(300)
.Border(false)
.Title("Edit Plants")
.Header(false)
// .Layout(LayoutType.Fit)
.Frame(true)
.Listeners(l =>
{
l.ViewReady.Fn = "addPlant";
l.ViewReady.Delay = 1;
})
.Store(
Html.X().Store().ID("Store1")
.Model(
Html.X().Model().ID("Model1")
.Name("PR")

.Fields(
Html.X().ModelField().Name("materialid").Type(ModelFieldType.Int),
Html.X().ModelField().Name("uomcode").Type(ModelFieldType.Int),
Html.X().ModelField().Name("avaiablestock").Type(ModelFieldType.Float),
Html.X().ModelField().Name("requireqty").Type(ModelFieldType.Float),
Html.X().ModelField().Name("UnitRate").Type(ModelFieldType.Float),
Html.X().ModelField().Name("totalvalue").Type(ModelFieldType.Float),
Html.X().ModelField().Name("approvedqty").Type(ModelFieldType.Float),
Html.X().ModelField().Name("approvedunitrate").Type(ModelFieldType.Float),
Html.X().ModelField().Name("approvedtotalvalue").Type(ModelFieldType.Float)

)
)


)

.ColumnModel(

Html.X().Column()
.MenuDisabled(true)
.Sortable(false)
.Text("Material")
.DataIndex("materialid")

.Width(130)
.Editor(
Html.X().ComboBox()
.ID("ddlMaterialID")
.ForceSelection(true)
.TypeAhead(true)
.SelectOnTab(true)
.DataIndex("MaterialName")
.ValueField("MaterialID")
.DisplayField("MaterialName")
.StoreID("stormaterialid")
.QueryMode(DataLoadMode.Local)
.TriggerAction(TriggerAction.All)

this is my code,combobox is load but after select item from combobox instead of displayfield valuefield is showing,what I doing wrong

Daniil
Jun 27, 2014, 11:39 AM
Hi @matrixwebtech,

In such the case uou should use a Column's Renderer. Please see the Department Column in this example:
http://mvc.ext.net/#/GridPanel_Data_Presentation/Editor_Field_Mapping/