I search the web a response to my question but I don't find anything...
I want to create a dialog allowing users to choose file for a "gallery" folder (for inserting image or attachment to the page). I retrieve folder content using Ajax calls and JSON description.
This part works well, CKEditor.ajax retrieves the data
I retrieve an array containing filename, icons, etc...
For each file I want to create an new UI element (HTML) for displaying content...
I do the work in this order :
- - Create empty dialog
- onLoad : get ajax content
-onShow : add content to the dialog (for that moment, add json string returned by server in an HTML element)
But onShow doesn't display json string...
Maybe I need to refresh dialog content ?
Remark : This howto http://docs.cksource.com/CKEditor_3.x/Howto/Editing_Dialog_Windows explains how to change dialog content before displaying it.
Thanks for your help.
Re: Dynamically add dialog content after dialog load
If you listen for other events like onLoad or onShow, they are fired on the final dialog instances, so the definition has already been parsed and no matter whatever changes you make to them now. If you want to customize the dialog now you have to work at a different level (plain HTML & JS or dig into the code to find out how to create elements at runtime)
Besides that, remember that CKEDITOR.ajax.load is asynchronous, so there's no warranty that firing it at onLoad would return the contents before the onShow event is fired, and you have to keep that in mind with whatever system you end up using.