Javascript 使用剑道网格链接列过滤器
如何使“城市”列中的下拉列表值根据选定的州进行过滤,以便仅显示该州内的城市Javascript 使用剑道网格链接列过滤器,javascript,sql,html,kendo-ui,kendo-grid,Javascript,Sql,Html,Kendo Ui,Kendo Grid,如何使“城市”列中的下拉列表值根据选定的州进行过滤,以便仅显示该州内的城市 function cityFilter(element) { element.kendoDropDownList({ dataSource: { transport: { read: "http://localhost:8888/City.php", dataType: "json" }
function cityFilter(element) {
element.kendoDropDownList({
dataSource: {
transport: {
read: "http://localhost:8888/City.php",
dataType: "json"
},
schema: {
data: "data"
}
},
dataTextField:"City",
dataValueField:"City",
optionLabel: "--Select Value--"
});
}
function stateFilter(element) {
element.kendoDropDownList({
dataSource: {
transport: {
read: "http://localhost:8888/State.php",
dataType: "json"
},
schema: {
data: "data"
}
},
dataTextField:"State_Long",
dataValueField:"State_Long",
optionLabel: "--Select Value--"
});
}
我就是这样做的:
function deviceFilter(element) {
element.kendoDropDownList({
dataTextField: "DeviceTypeName",
dataValueField: "DeviceTypeName",
dataSource: {
transport: {
read: "@Url.Action("DeviceTypes", "Device")"
}
},
optionLabel: "--Select Value--",
change: deviceFilterChange
});
}
function deviceFilterChange() {
var value = this.value(),
grid = $("#DevicesRadGrid").data("kendoGrid");
if (value) {
grid.dataSource.filter({ field: "DeviceType", operator: "eq", value: value });
} else {
grid.dataSource.filter({});
}
}
没有人有任何想法?