2

Closed

jHtmlArea and jQuery dialog again

description

Hi,
I have some similar problem like in issue 8499 (textarea is disabled), but whit some difference. I have master page which has function openDialog in this way:
function openDialog(url, data, curWidth, winTitle) {    
    var dialogDiv = jQuery(document.createElement("div"));      
    dialogDiv.attr("id", "dialog"); 
    dialogDiv.dialog({
        bgiframe: false,
        autoOpen: false,
        title: winTitle,            
        position: 'top', 
        width: curWidth,
        maxHeight: 600,
        maxWidth: curWidth,
        open: function() {
            var rand_no = Math.random();                
            data.rnd = rand_no;                 
            dialogDiv.load(url, data);               
        },
        close: function() {              
             dialogDiv.remove();                     
        }

        /*,
        buttons: {
            Cancel: function() {
                $(this).dialog('close');
            },
            Save: function() {                  
                $(this).dialog('close');
            }
        }*/
    });
    dialogDiv.dialog('open');       
}
 
 
I'm creating div and after that loading some another page to it (open: function() {
            var rand_no = Math.random();                
            data.rnd = rand_no;                 
            dialogDiv.load(url, data);               
        },
)
 
At those page I have some textarea with jHtmlArea editor which initialising in this way :
 
<script type="text/javascript"> $(document).ready(function(){ $("#html").htmlarea();   }); </script> <textarea rows="10" id="html"></textarea>
 
This editor renrders corectly, but it is in readonly mode.
Is it bug? How can I fix this?
 
Thanks in advance,
Paul
Closed Aug 4, 2012 at 3:55 AM by crpietschmann

comments

Butik wrote Nov 9, 2009 at 8:30 AM

Issue can be closed.
Solution:

open: function() {
            var rand_no = Math.random();                
            data.rnd = rand_no;                 
            dialogDiv.load(url, data,  function(){
                    // init HTML areas on edot page
                    dialogDiv.find('#htmlUA').htmlarea({
                         // Override/Specify the Toolbar buttons to show
                        toolbar: [
                            ["html"], ["bold", "italic", "underline", "|", "forecolor"],
                            ["increasefontsize", "decreasefontsize"],
                            ["orderedlist", "unorderedlist"],
                            ["justifyleft", "justifycenter", "justifyright"],
                            ["link", "unlink", "image"]         
                        ]}
                    );                      
                   dialogDiv.find("#htmlEN").htmlarea({
                         // Override/Specify the Toolbar buttons to show
                        toolbar: [
                            ["html"], ["bold", "italic", "underline", "|", "forecolor"],
                            ["increasefontsize", "decreasefontsize"],
                            ["orderedlist", "unorderedlist"],
                            ["justifyleft", "justifycenter", "justifyright"],
                            ["link", "unlink", "image"]         
                        ]}
                    );  
                }
           );                
        }