NicEdit supports having a save button the toolbar that users can click to save content.
To use this mode you should have some understanding of javascript and follow these steps:
- First make sure you have configured your download with the nicSave plugin
- Use the onSave option when you declare you nicEditor instance, for example:
-
bkLib.onDomLoaded(function(){
-
new nicEditor({fullPanel : true, onSave : function(content, id, instance) {
-
alert('save button clicked for element '+id+' = '+content);
-
} }).panelInstance('myArea2');
-
});
- Because we have set the onSave option to our callback function, and included the 'save' button the save icon will appear on our toolbar
- When clicking the button, the onSave callback will run with 3 parameters
- The first parameter is the content of the nicEditor instance
- Second parameter is the ID of the element converted to a nicEditor
- Third parameter is a reference to the nicInstance (see Javascript API for more info on that)