我可以自定义ckeditor插件对话框的“确定"和“取消"按钮的标签吗 [英] Can I customize the label of OK and Cancel buttons of ckeditor plugin dialog
本文介绍了我可以自定义ckeditor插件对话框的“确定"和“取消"按钮的标签吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已将插件创建到CK编辑器JS框架中.我能够为我的插件显示一个对话框,其中包含几个字段.但是我需要控制确定"和取消"按钮的css属性,例如标签,颜色等.这种自定义可能吗?
I have plugin created into the CK editor JS framework. I was able to show a dialog for my plugin with few fields. But I need to control the OK and Cancel buttons css properties like the label, color etc. It this customization possible ?
推荐答案
有 override 方法可以覆盖传入的参数.它在Ckeditor 4上对我有效.尝试:
There is override method which overrides passed in parameters. It works for me on Ckeditor 4. Try it:
CKEDITOR.dialog.add( 'getlinkDialog', function ( editor ) {
return {
title: 'Dialog title',
minWidth: 300,
minHeight: 70,
contents: [
{
id: 'getlink-basic',
label: 'Basic Settings',
elements: [
{
type: 'text',
id: 'link',
label: 'Enter your name'
}
]
}
],
buttons: [
CKEDITOR.dialog.okButton.override( { label : 'My Label'} ),
CKEDITOR.dialog.cancelButton.override( {} )
],
onOk: function() {
//Your code
}
};
});
这篇关于我可以自定义ckeditor插件对话框的“确定"和“取消"按钮的标签吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文