【问题标题】:How do you extend Kendo UI widgets你如何扩展 Kendo UI 小部件
【发布时间】:2012-03-07 23:44:20
【问题描述】:

我在 Kendo UI 的网站上找不到任何关于扩展 Kendo UI 小部件或制作复合控件的官方文档。 是否有任何示例说明如何执行此操作?

【问题讨论】:

    标签: widget extend kendo-ui


    【解决方案1】:

    我即将就此写一篇文章,但您可以在 GitHub 上查看以下项目以创建插件。目前对此有一个复合控件...

    https://github.com/kendo-labs/kendo-plugins

    这是一个合成 AutoComplete 和 ListView 的现场小提琴示例...

    http://jsfiddle.net/burkeholland/G2f4a/embedded/result/

    // thanks for making put a useless comment here stackoverflow
    

    【讨论】:

    【解决方案2】:

    现在有官方文档: How to Create a Custom Widget

    这是半官方community plugins的链接。

    这里有一些 examples 由 John DeVight 创建的小部件。

    An SO post showing a simple example 扩展了移动列表视图。

    【讨论】:

    • 这应该是今天公认的答案。但是,上面的链接不包括在将 Kendo 与 AngularJS 一起使用时创建自定义小部件,这当然不是 OP 所要求的,但知道它仍然非常有帮助:)
    【解决方案3】:

    谢谢!有了这个帮助,我可以做到:

    kendo.data.DataSource.prototype.dataFiltered = function () {
        // Gets the filter from the dataSource
        var filters = this.filter();
    
        // Gets the full set of data from the data source
        var allData = this.data();
    
        // Applies the filter to the data
        var query = new kendo.data.Query(allData);
    
        // Returns the filtered data
        return query.filter(filters).data;
    }
    

    【讨论】:

      猜你喜欢
      • 2011-02-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-24
      相关资源
      最近更新 更多