所以我有两个下拉列表,我想从第二个下拉列表中获取另一个 json 属性,而不是归因于 dataTextField 或 dataValueField 的属性。这是引用的下拉列表:
$("#campoFormLinha"+index).kendoDropDownList({
optionLabel: "Campo",
dataTextField: "name",
dataValueField: "id",
dataSource: {
type: "json",
serverFiltering:true,
transport: {
read:{
url:"${pageContext.request.contextPath}" + "/newlayout/mySearchesFormFieds.do",
data:function(){
return {formId: $("#dynamicFormLinha"+index).val()
};
}
}
}
},
cascadeFrom: "dynamicFormLinha"+index
}).data("kendoDropDownList");
这是它返回的json:
[{"id":9,"name":"Cliente","type":"STRING"},{"id":10,"name":"Contribuinte","type":"STRING"},{ "id":11,"name":"Facturação","type":"STRING"},{"id":12,"name":"Conta","type":"STRING"},{"id ":13,"name":"Factura","type":"STRING"},{"id":14,"name":"Valor","type":"STRING"}]
因此,假设所有这些,我想根据所选选项获取类型属性。
我怎样才能做到这一点?