各位大侠你们好。小弟初学ext。net.在数据绑定这块参照API。出现无效数据源的错误,那么我该怎么给他指定数据源呢
X.ComboBox()
.ID("ComboBox")
.TypeAhead(true)
.TriggerAction(TriggerAction.All)
.FieldLabel("下拉框绑定值")
.Store(X.Store()
.ID("store")
.AutoLoad(false)
.Model(X.Model()
.IDProperty("ID")
.Fields(
// new ModelField("ID",ModelFieldType.Int),
// ModelField("Name")
new ModelField("Id", ModelFieldType.Int) { Mapping="Id"},
new ModelField("Name", ModelFieldType.String) { Mapping = "Name" }
// f => { f.Add(X.ModelField().Type(ModelFieldType.Int)); }
)
)
.DataSource(Model)
)
)
.DataSource(Model)
)
X.GridPanel()
.ID("GridPanel1")
.Title("静态车次")
.Region(Region.Center)
.Height(600)
.Collapsible(true)
.Store(X.Store().AutoLoad(false))
//.Store(X.Store().AutoLoad(false)
//.Model(X.Model()
// .Fields(
// new ModelField("Id",ModelFieldType.Int),
// new ModelField("Name")
.TopBar(X.Toolbar()
.Items(
X.Button().Text("新增").Icon(Icon.NewspaperAdd),
X.Button().Text("查看配载车次清单").Icon(Icon.ArrowRefreshSmall)
)
)