I would like to remove all id attributes before getData() returns data to the user.
I am currently trying to remove the id attributes on beforeGetData and the getData events:
editor.on('beforeGetData', function(e){ e.editor.undoManager.lock(); var ids = e.editor.element.find('[id]'); for(i = 0; i < ids.count(); i++){ ids.getItem(i).removeAttribute('id'); } e.editor.undoManager.unlock(); });
editor.on('getData', function(e){ e.editor.undoManager.lock(); var ids = e.editor.element.find('[id]'); for(i = 0; i < ids.count(); i++){ ids.getItem(i).removeAttribute('id'); } e.data.dataValue = e.editor.getData(true); e.editor.undoManager.unlock(); });
However, in all cases, it appears that getData() returns old data even after modification to the dom. How can I remove all id attributes before returning data?