2013-04-28 95 views
0

我试图用kendo编辑器创建图片上传。 我总是得到一个错误:kendo编辑器ReferenceError:没有定义uid

ReferenceError: uid is not defined

...==E&&(E=1),g?(b&&(A+=-b),w&&(I+=-w),e=new Date(Date.UTC(F,D,E,A,I,H,N))):(e=new ...

kendo.web.min.js (Zeile 11)

我使用jQuery 1.8.3和kendoui.web.2013.1.319.open源

我的代码如下:

<div id="example" class="k-content"> 
    <textarea id="editor" rows="10" cols="30" name="reply-content"></textarea> 
</div> 
     <script> 
      $(document).ready(function() { 
       $("#editor").kendoEditor({ 
        imageBrowser: { 
         messages: { 
          dropFilesHere: "Drop files here" 
         }, 
         transport: { 
          read: "/images/ImageBrowser/Read", 
          destroy: "/images/ImageBrowser/Destroy", 

          create: "/images/ImageBrowser/Create", 

          thumbnailUrl: "/images/ImageBrowser/Thumbnail", 
          uploadUrl: "/images/ImageBrowser/Upload", 
          imageUrl: "/images/ImageBrowser/Image?path={0}" 
         } 
        } 
       }); 
      }); 
     </script> 

有人遇到同样的问题?

回答

0

您可能正在返回一个字符串列表,但编辑器正在等待一个json结果(名称,类型,大小)。您可以使用嗅探器来检查演示,以了解读取/缩略图等方面的预期结果。不太确定您是否真的必须为Kendo的客户端实现一个服务器类,但默认情况下,预计读取的结果作为Json肯定。

+0

相反,读取预计根据“应用程序/ x-WWW的形式,进行了urlencoded”默认的contentType到[文档](http://docs.telerik.com/kendo-ui/api/web/editor#configuration-imageBrowser.transport.read.contentType)。 – 2014-04-30 01:01:11

0

新finaly我得到它的工作。我使用了一些解决方法,但看到你的自我。

您还可以测试网站上的功能:http://jonas.dnsd.me/forum/topic?id=113

但STIL它有一些缺陷,如网址:/imageBrowser/?path=/image.jpg。我使用javascript函数删除了'/?path =',但它仅适用于3张图片。 如果您上传图片,窗口将不会重新制作。

我很感谢关于这些问题的一些想法。

现在,它正在像一个魅力......看到http://jonas.dnsd.me/forum/topic?id=113 我更新到新的源代码