0

我正在尝试在我的剑道网格中使用自定义菜单过滤器。使用此代码,菜单永远不会加载,只是一直有旋转的圆圈。我正在使用最新版本的剑道。我究竟做错了什么?

{
 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). "}";

?>
4

1 回答 1

0

一切看起来都对您的代码有效。确保您有可用的服务。是带有您的代码的jsbin,仅在传输方面有所不同:

例如

  function cityFilter(element) {
   element.kendoDropDownList({
    dataSource: {
      severFiltering: true,
      transport: {
          read: {
            dataType: "jsonp",
            url: "http://demos.kendoui.com/service/Products"
          }
      },
      },
    dataTextField:"ProductName",
    optionLabel: "--Select Value--"
   });
 }
于 2013-05-05T17:54:23.260 回答