我正在尝试在我的剑道网格中使用自定义菜单过滤器。使用此代码,菜单永远不会加载,只是一直有旋转的圆圈。我正在使用最新版本的剑道。我究竟做错了什么?
{
field: "City",
title: "City",
width: 110,
filterable: {
ui: cityFilter
}
}
function cityFilter(element) {
element.kendoDropDownList({
dataSource: {
type: "odata",
severFiltering: true,
transport: {
read: "http://localhost:8888/City.php"
}
},
optionLabel: "--Select Value--"
});
}
php:
<?php
$link = mysql_pconnect("127.0.0.1", "root", "admin") or die("Unable To Connect To Database Server");
mysql_select_db("MainDatabase") or die("Unable To Connect To Northwind");
$arr = array();
$rs = mysql_query("SELECT State_Long FROM MainDatabase.Stations Group by State_Long");
while($obj = mysql_fetch_object($rs)) {
$arr[] = $obj;
}
// add the header line to specify that the content type is JSON
header("Content-type: application/json");
echo "{\"data\":" .json_encode($arr). "}";
?>