2013-05-05 3 views
0

내 검도 그리드에서 작동하는 사용자 정의 메뉴 필터를 얻으려고합니다. 이 코드를 사용하면 메뉴가로드되지 않으며 항상 순환 원이 있습니다. 나는 kendo의 최신 버전을 사용하고 있습니다. 내가 도대체 ​​뭘 잘못하고있는 겁니까?검도 사용자 정의 필터 작동 방법

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

?> 

답변

0

모든 유효한 보인다. 서비스를 사용할 수 있는지 확인하십시오. Here은 전송에만 다른 코드가있는 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--" 
    }); 
} 
+0

알겠습니다. { 전송 : { 읽기 : "HTTP : // localhost를 : 8888/City.php" }, 스키마 : { 나는이 .. 기능 cityFilter (요소) { element.kendoDropDownList ({ 데이터 소스를했다 데이터 : "데이터" }}, serverFiltering : true, dataTextField : "State_Long", optionLabel : "- 선택 값 -" }); } –