나는 퀘스트 목록에있는 겐도우 그리드가 있습니다. 컬럼 중 하나는 대금업자 테이블에 대한 외래 키 참조 인 대금업자입니다. 내가 원하는 것은 ID 참조 대신 그리드에 대금업자 이름을 표시 할 수 있어야한다는 것입니다.kendoui : 그리드에 원격 데이터 소스에서 외래 키를 표시하는 방법
필자 설정 대출 데이터 소스
var dsLenders = new kendo.data.DataSource({
transport: {
read: {
url: "../data/lenders/",
dataType: "jsonp"
},
parameterMap: function(options, operation) {
if (operation === "read") {
return options;
}
}
}
});
을 다음과 여전히 대출 열의 ID를 표시하지만 그리드이
$("#gridClaims").kendoGrid({
dataSource: claimData,
autoSync:true,
batch: true,
pageable: {
refresh: true,
pageSizes: true
},
filterable: true,
sortable: true,
selectable: "true",
editable: {
mode: "popup",
confirmation: "Are you sure you want to delete this record?",
template: $("#claimFormPopup").html()
},
navigable: true, // enables keyboard navigation in the grid
toolbar: ["create"], // adds insert buttons
columns: [
{ field:"id_clm", title:"Ref", width: "80px;" },
{ field:"status_clm", title:"Status", width: "80px;" },
{ field:"idldr_clm", title:"Lender", values: dsLenders },
{ field:"type_clm", title:"Claim Type"},
{ field:"value_clm", title:"Value", width: "80px;", format:"{0:c2}", attributes:{style:"text-align:right;"}},
{ field:"created", title:"Created", width: "80px;", format: "{0:dd/MM/yyyy}"},
{ field:"updated", title:"Updated", width: "80px;", format: "{0:dd/MM/yyyy}"},
{ field:"user", title:"User" , width: "100px;"},
{ command: [
{text: "Details", className: "claim-details"},
"destroy"
],
title: " ",
width: "160px"
}
]
});
처럼 보이는. 필자는 로컬 데이터 소스를 만들려고 했으므로 이제는 원격 데이터 소스를 사용하여 저와 관련이 있습니다.
어떤 도움
참으로 내가 꼭이 검도이 만드는 얼마나 어려운 SUPER 짜증나는 말을 추가 한 경우 그리드 열 "term_id"을 참조하십시오, 드롭 다운리스트가 생성됩니다. 좀 더 우아한 해결책을 제시하기 위해 여러 가지 방법을 시도했지만 격자는 단순히 비동기 적으로로드되는 새로운 값을 선택하지 않습니다. 그래서 기본적으로 값 배열을 미리 채우기 위해 모든 쿼리를 실행해야 그리드와 관련된 작업을 수행 할 수 있습니다. 매우 실망 스럽습니다. 이것은 각도 지시문을 사용하기가 어렵 기 때문에 이것을 올바르게 처리하는 방법은 Jquery를 사용하여 그리드를 새로 작성하는 것입니다. –