• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Finally, you can manage your Google Docs, uploads, and email attachments (plus Dropbox and Slack files) in one convenient place. Claim a free account, and in less than 2 minutes, Dokkio (from the makers of PBworks) can automatically organize your content for you.

View
 

Saving via AJAX

Page history last edited by diogo 11 years, 11 months ago

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:

 

  1. bkLib.onDomLoaded(function(){
  2.   new nicEditor({fullPanel : true, onSave : function(content, id, instance) {
  3.     alert('save button clicked for element '+id+' = '+content);
  4.   } }).panelInstance('myArea2');
  5. });

 

  • 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)

 

Comments (0)

You don't have permission to comment on this page.