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
Post a Comment