Hello Everyone,
I am developing a ASP.NET MVC program with angular kendoUI, my program gets JSON data successfully, but the data can not display in kendo GRID normally. Could anyone provide some advice, thank you.
Image:
Javascript:
function
getDetailRouting(dataItem) {
return
{
dataSource: {
//data: $scope.Structure
//type: "Json",
transport: {
read:
"/api/routings/details/"
+ dataItem.Model +
"/"
+ dataItem.PCBA
}
,
schema: {
data:
"data"
,
model: {
fields: {
Model: { type:
"string"
},
PCBA: { type:
"string"
},
SeqNo: { type:
"int"
},
Process: { type:
"string"
},
FailedUnitReturnTo: { type:
"string"
},
MaxTestRound: { type:
"int"
},
MaxFailure: { type:
"int"
},
StandardTime: { type:
"date"
},
SamplingTest: { type:
"boolean"
},
SamplingLogic: { type:
"string"
},
PanelMatching: { type:
"boolean"
},
PanelSize: { type:
"int"
},
RetestFlag: { type:
"string"
},
MatchingbyExtSN: { type:
"boolean"
},
Label1: { type:
"string"
},
Label2: { type:
"string"
},
Label3: { type:
"string"
},
}
}
},
serverPaging:
true
,
serverSorting:
true
,
serverFiltering:
true
,
pageSize: 5,
////filter: { field: "EmployeeID", operator: "eq", value: dataItem.EmployeeID }
},
height: 150,
scrollable:
true
,
sortable:
true
,
pageable:
true
,
filterable:
true
,
columns: [
{ field:
"Model"
, title:
"Model"
, width:
"56px"
},
{ field:
"PCBA"
, title:
"PCBA"
, width:
"110px"
}
]
};
}
Html:
<div kendo-grid id=
"grid"
k-options=
"StructureGrid"
k-data-source=
"StructureGrid.dataSource"
>
<div k-detail-template>
<kendo-tabstrip>
<ul>
<li class=
"k-state-active"
>Routing</li>
<li>Contact information</li>
</ul>
<div>
<div kendo-grid k-options=
"getDetailRouting(dataItem)"
></div>
</div>
<div>
<ul class=
"contact-info-form"
>
<li><label>SeqNo:</label> <input class=
"k-textbox"
ng-model=
"dataItem.Country"
/></li>
<li><label>Process:</label> <input class=
"k-textbox"
ng-model=
"dataItem.City"
/></li>
<li><label>Failed Unit Return TO:</label> {{dataItem.Address}}</li>
</ul>
</div>
</kendo-tabstrip>
</div>
</div>