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

  • Stop wasting time looking for files and revisions. Connect your Gmail, DriveDropbox, and Slack accounts and in less than 2 minutes, Dokkio will automatically organize all your file attachments. Learn more and claim your free account.

View
 

Saving via AJAX

Page history last edited by diogo 11 years, 4 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.