3.2.0

Mozilla XUL

I was wondering if anyone has used an AW Grid with Mozilla XUL extension. I have been able to do it by basically "embedding" a html file within a XUl iframe. The html file is much like some grid example with basic grid definition ... css and creating a grid object, defining number of rows and columns and some other initial configuration. Further interaction with the grid using xul controls/javascript was done in a awkward and roundabout way (using notifiers/observers). That was the only way I could get it to work. I tried embedding pretty much the html file example content directly within xul but it would not render the right.

So if anyone has any experience with this, I would appreciate it.

Thanks,
Charlie



harle11
March 26,
I am not expert in XUL, so here is the code I was trying:

<?xml version="1.0"?>
<?xml-stylesheet href="file:grid.css" type="text/css"?>
<window xmlns:html="http://www.w3.org/1999/xhtml"
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  onload="insertHTML()"
  >
    <hbox>
        <button label="Test"></button>
    </hbox>
    <hbox height="200px" width="400px">
        <html:div id="myBox"></html:div>
    </hbox>

    <html:script src="grid.js"/>
    <html:style>
        #myBox {
         	-moz-box-flex: 1;
         	position: relative;
         	overflow: hidden;
         	border:1px solid #ccc;
        }

        #myGrid {
            font:menu;
            width: 100%;
            height: 100%;
        }
    </html:style>
    <html:script>
        <![CDATA[

        function insertHTML() {
            var div = document.getElementById("myBox");

            var obj = new Active.Controls.Grid;
            obj.setId("myGrid");
            obj.setColumnCount(10);
            obj.setRowCount(10);
            obj.setDataText("-");

            var s = "";
            s += "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
            s += obj.toString().replace(/&nbsp;/g, "");
            s += "</html>";

            var parser = new DOMParser();
            var doc = parser.parseFromString(s, "text/xml");
            div.appendChild(doc.firstChild.firstChild);
        }
        ]]>
    </html:script>
</window>


You have to copy style files and grid.js to the same directory and then, well, you can see the grid and even resizing works :-) but not much else.

I found that neither range.createContextualFragment nor innerHTML work inside XUL (contrary to the documentation). If anyone can tell whats wrong here I would really appreciate it.

BTW: Why are you using AW grid in XUL instead of native grid ?????
Alex (ActiveWidgets)
March 27,

This topic is archived.

See also:


Back to support forum