Extjs在HtmlEditor的工具栏上插入自定义按钮
Ext.ns('Ext.ux.form.HtmlEditor');Ext.ux.form.HtmlEditor.HR =Ext.extend(Ext.util.Observable,{ init:function(cmp){this.cmp = cmp;this.cmp.on('render',this.onRender,this);}, onRender:function(){this.cmp.getToolbar().addButton([{ iconCls:'x-edit-custom',//your iconCls here handler:function(){this.cmp.insertAtCursor('<hr>');}, scope:this, tooltip:'horizontal ruler', overflowText:'horizontal ruler'}]);}});var w =newExt.Window({ width:550, layout:'fit', items:[{ xtype:'htmleditor', plugins:[newExt.ux.form.HtmlEditor.HR()]}]}); w.show();
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步