javascript - CKEditor One instance for multiple ID's -


can use 1 configuration ckeditor multiple id's?

i have config in page :

var editor = ckeditor.replace('dsi3',{               toolbar :                 [                     { name: 'basicstyles', items : [ 'bold','italic'] },                     { name: 'paragraph', items : [ 'bulletedlist'] }                  ],             width: "210px",             height: "140px"         }); 

but have past again , again different ids, instead wanna :

var editor = ckeditor.replace('dsi3, dsi4, dsi5, dsi6',{                 toolbar :                 [                     { name: 'basicstyles', items : [ 'bold','italic'] },                     { name: 'paragraph', items : [ 'bulletedlist'] }                  ],             width: "210px",             height: "140px"         }); 

you can user variable options.

var editor_config = {     toolbar: [         {name: 'basicstyles', items: ['bold', 'italic']},         {name: 'paragraph', items: ['bulletedlist']}     ],     width: "210px",     height: "140px" };  ckeditor.replace('dsi3', editor_config ); ckeditor.replace('dsi4', editor_config ); ckeditor.replace('dsi5', editor_config ); ckeditor.replace('dsi6', editor_config ); 

or jquery, matching ids starting "dsi":

$('[id^=dsi]').ckeditor({     toolbar: [         {name: 'basicstyles', items: ['bold', 'italic'] },         {name: 'paragraph', items: ['bulletedlist'] }     ],     width: "210px",     height: "140px" }); 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -