2013-12-15 57 views
0

我試圖使用kendoui外部文件管理器。使用kendo-ui外部文件管理器

http://www.kendoui.com/forums/kendo-ui-web/general-discussions/why-not-make-image-browser-in-editor-as-separate-controle.aspx#0Hdg62t7dEql6QiANReisg

<div id="imgBrowser"></div> 

$("#imgBrowser").kendoImageBrowser({ 
    transport: { 
     read: "/service/ImageBrowser/Read", 
     destroy: { 
      url: "/service/ImageBrowser/Destroy", 
      type: "POST" 
     }, 
     create: { 
      url: "/service/ImageBrowser/Create", 
      type: "POST" 
     }, 
     thumbnailUrl: "/service/ImageBrowser/Thumbnail", 
     uploadUrl: "/service/ImageBrowser/Upload", 
     imageUrl: "/service/ImageBrowser/Image?path={0}" 
    } 
}); 

而且有以下錯誤:http://22.uco.co.il/filebrouser.png

有人嘗試嗎?你可以有

http://jsfiddle.net/wcze9/85/

回答

0

的一個問題是,根據documentation,默認情況下,ImageBrowser的的讀取動作預計數據與「應用程序/ x-WWW的形式,進行了urlencoded」 contentType都。如果您從服務器返回JSON,ImageBrowser將無法正確解釋它。使用文檔中的示例將預期從Read操作獲得的contentType更改爲「application/json」:

<textarea id="editor"></textarea> 
<script> 
$("#editor").kendoEditor({ 
    imageBrowser: { 
    transport: { 
     read: { 
     /* omitted for brevity */ 
     contentType: "application/json" 
     } 
    } 
    } 
}); 
</script>