Having a small issue where sometimes the editor will show the contents from setdata and sometimes not. I can refresh the page and have content load and then refresh and have it be blank?
Details: I set up the editor and call a function that does a setdata
$(function () {
CKEDITOR.config.toolbar = [
['Styles','Format','Font','FontSize'],
['Bold','Italic','Underline','StrikeThrough','-','Undo','Redo','-','Cut','Copy','Paste','Find','Replace','-','Outdent','Indent','-','Print'],
['NumberedList','BulletedList','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['TextColor','BGColor']
] ;
CKEDITOR.replace('Comments');
fillit();
});
before the fillit() function was also on page load but I though I was having issues with async doing both at once (aka trying to setdata to something that was not there yet). The fillit() function makes a JSON call and gets data to put in the editor.
portion of my success function from the $.ajax
success: function (data) {
//parse the JSON
var tmp = $.parseJSON(data);
//alert(tmp[0].Name);
//populate boxes
$("#phone").val(tmp[0].Phone);
$("#name").val(tmp[0].Name);
$("#pext").val(tmp[0].PExt);
$("#address").val(tmp[0].Address);
$("#city").val(tmp[0].City);
$("#prov").val(tmp[0].Prov);
$("#pcode").val(tmp[0].PCode);
$("#HOO").val(tmp[0].HOO);
$("#contact").val(tmp[0].Contact);
$("#billedto").val(tmp[0].BilledTo);
$("#territory").val(tmp[0].Territory);
$("#ClientCustNum").val(tmp[0].ClientCustNum);
$("#PONum").val(tmp[0].PONum)
$("#CustID").val(tmp[0].CustID);
$("#CallType").val(tmp[0].CallType);
CKEDITOR.instances.Comments.setData(tmp[0].Comments);
This does work but sometimes when the pages loads the editor will be blank and other times (refreshing that page) it loads the content. I can sit here pressing F5 and it will load fine on some refreshes and not on others.
Any ideas?
Thank you for any help,
Norst
