0
我一直在使用asp.net mvc4和剑道的UI工具开发的Web应用程序..如何绑定模型剑道电网数据源
在那里我需要绑定模型网格数据源或模式的情况下直接创建在架构领域..
这里是我网格的代码..
function LoadGridView() {
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "Items/ReadItemDetails",
dataType: "json"
},
create: {
url: "Items/InsertItemDetails",
dataType: "json"
},
update: {
url: "Items/UpdateItemDetails",
Type: "POST",
dataType: "jsonp"
},
destroy: {
url: "Items/DeleteItemDetails",
dataType: "json"
}
},
batch: true,
pageSize: 30,
schema: {
model: {
id: "ItmKy",
fields: {
ItmCd: { editable: true, nullable: true },
ItmNm: { editable: true, nullable: true },
Unit: { editable: true, nullable: true },
isAct: { editable: true, nullable: true }
}
}
}
});
}
我需要一个型号名称传递到架构,而不是此行的
schema: {
model: {
id: "ItmKy",
fields: {
ItmCd: { editable: true, nullable: true },
ItmNm: { editable: true, nullable: true },
Unit: { editable: true, nullable: true },
isAct: { editable: true, nullable: true }
}
}
}
我想这样,但随后的电网不工作..
schema: {
model: @Model
}
可以请人帮助我,告诉我怎样才能模型绑定模式,或者如果可能的数据源 ..
这里是模型类
namespace KendoModel
{
public class ItemMas_LookUp
{
public long ItmKy { get; set; }
public string ItmCd { get; set; }
public string ItmNm { get; set; }
public int UnitKy { get; set; }
public int isAct { get; set; }
public string Unit { get; set; }
public ItemMas_LookUp()
{
}
}
}
我想你的答案应该可以工作,但实际上我的问题是我需要绑定一个模型,我使用一个单独的类创建..请参考我提到的最后一个问题的模型类的代码,然后请告诉我怎么可以我将它绑定到网格.. – sanzy
就像我在我的回答中提到的那样,您将需要使用Razor创建网格 - 我之前没有这样做。看看他们的文档。 :) – Jeff
如果是这样,你可以请给我电话的方式,我可以绑定模型,如果我用剃刀创建网格..请帮助我,因为我是新来的.. – sanzy