3.0 beta 2

XML data island

Hi
I am new to this I want to load the grid with
XML from a DataIsland that has come from the
server How do I do this??? Help
Thanks,
Cathy
cathy
May 14,
Here is an example

<html>
<head>
    <title>ActiveWidgets Grid :: Examples</title>
    <style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>

    <!-- ActiveWidgets stylesheet and scripts -->
    <link href="../../runtime/styles/classic/grid.css" rel="stylesheet" type="text/css" ></link>
    <script src="../../runtime/lib/grid.js"></script>

    <!-- grid format -->
    <style>
        .active-controls-grid {height: 100%; font: menu;}
    </style>
    <xml id="xmldata">
        <companies>
            <company>
                <ticker>MSFT</ticker>
                <name>Microsoft Corporation</name>
                <mktcap>314,571.156</mktcap>
                <sales>32,187.000</sales>
                <employees>55000</employees>
            </company>
            <company>
                <ticker>ORCL</ticker>
                <name>Oracle Corporation</name>
                <mktcap>62,615.266</mktcap>
                <sales>9,519.000</sales>
                <employees>40650</employees>
            </company>
            <company>
                <ticker>SAP</ticker>
                <name>SAP AG (ADR)</name>
                <mktcap>40,986.328</mktcap>
                <sales>8,296.420</sales>
                <employees>28961</employees>
            </company>
        </companies>
    </xml>
</head>
<body>
    <script>

    //	create ActiveWidgets data model - XML-based table
    var table = new Active.XML.Table;

    //	provide XML data (see xml data island id)
    table.setXML(xmldata);

    //	define column labels
    var columns = ["Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"];

    //	create ActiveWidgets Grid javascript object
    var obj = new Active.Controls.Grid;

    //	provide column labels
    obj.setColumnProperty("texts", columns);

    //	provide external model as a grid data source
    obj.setDataModel(table);

    //	write grid html to the page
    document.write(obj);

    </script>
</body>
</html>

Alex (ActiveWidgets)
May 14,
thanks,
I got it working it looks great..
Cathy
May 18,
Above code is invaild as

1. "XML data island" is not standard HTML/XHTML

2.
<code>
// provide XML data (see xml data island id)
table.setXML(xmldata);
</code>

xmldata variable is not defined/initialized
John
October 17,
I am trying to do this in version 2.0 and I am getting an invalid procedure call???
Jim Shaffer
October 19,
ASP Part:

rstData.Open strSQL, DataConn, adOpenForwardOnly, adLockReadOnly, adCmdText

Dim xml, xsl
Set xml = Server.CreateObject("MSXML2.DOMDocument")
Set xsl = Server.CreateObject("MSXML2.DOMDocument")

xml.async = False
xsl.async = False
rstData.Save xml, 1 'adPersistXML
xsl.load Server.MapPath("z.xsl")
strXML = xml.transformNode(xsl)
Set xsl = Nothing
Set xml = Nothing

<xml id="xmldata"><companies><%=strXML%></companies></xml>

Active Widgets Part:

<script language="javascript">
var table = new AW.XML.Table;
table.setXML(xmldata); //provide data URL
table.request(); // start asyncronous data retrieval
var columns = ["Contract/Task", "Task Title", "Project Controller", "Tier Level", "Tool", "Lead Div." , "CRN", "Prime CAN", "Start Date", "End Date", "Contract Type", "Negotiated Value", "Funded Value", "EAC Revenue", "EAC Fee", "EAC Fee %", "EAC Date", "Prior EAC Fee %", "Prior EAC Date" , "Issues/Comments"];

var obj = new AW.Grid.Extended;
obj.setId("myGrid");
obj.setControlSize(900, 450); // width, height of grid
obj.setColumnCount(20); //Number Of Columns to display
obj.setHeaderCount(1); // number of fixed header rows
obj.setHeaderText(columns);
obj.setFooterVisible(true); //Footer Info
obj.setFooterCount(1); //number of footer rows
obj.setFooterText(columns); // provide column labels
obj.setVirtualMode(true); //Virtual Mode
obj.setFixedLeft(1); // number of fixed columns on the left side
obj.setFixedRight(0); // number of fixed columns on the right side
obj.setSelectorVisible(true); //enable row selectors
obj.setSelectorText(function(i){return this.getRowPosition(i)});
obj.setSelectorWidth(0);
obj.setSelectionMode("single-row"); // set row selection
obj.setCellModel(table); // provide external model as a grid data source
document.write(obj); // write grid html to the page
</script>
Jim Shaffer
October 19,
Hoping to get an answer about my previous post
Jim Shaffer
October 20,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.