Redactor this.insert.html()不起作用

时间:2015-10-21 14:08:13

标签: javascript jquery redactor

我使用Redactor II作为我正在开发的CMS的文本编辑器,问题是一个小功能不起作用,我不知道为什么,因为一切都安装得很好,并且正在我之前使用过Redactor的网站上工作。

即使是Table插件和行按钮也无法正常工作。这是我正在制作插件的一个例子。

var grid_items = {};
$.Redactor.prototype.grids = function()
{
    return {
        init: function()
        {
            grid_items.grid01 = { title: '20-80', func: this.grids.insertGrid };
            grid_items.grid02 = { title: '20-20-60', func: this.grids.insertGrid };
            var button = this.button.add('grids', '<i class="fa fa-table"></i>');
            this.button.addDropdown(button, grid_items);
            $redactor = this;
        },
        insertGrid: function(button)
        {
            var grid = grid_items[button].title;
            var grids = grid.split('-');
            var html = '';
            $.each(grids, function(){
                html += '<p>123</p>';
            });
            this.insert.html(html);
        }
    };
};

问题出在最后一行,this.insert.html()无效,但this.insert.set()有效。他们做了不同的事情,如api文档中所述。

这不是我的插件问题,因为使用它的官方插件也不起作用......

之前有人遇到过这种情况吗?我在这里缺少什么?

0 个答案:

没有答案