Problem with innerHTML
Hi, my English skill not so good, so sorry. I trying to add in my Ajax function this grid and have strange problem. Ok i will try to explain:
I have CSS:
div#content
{
border-top:2px solid #e0dfe3;
}
div#content div.cContent
{
border:1px solid #9d9da1;
margin-right:1px;
margin-bottom:1px;
padding-top:1px;
overflow:auto;
}
Have DIV in HTML:
<div id="c3" class="cContent">
<div>
<!-- Main page -->
</div>
</div>
I have xml from example:
companies-simple.xml
So then I trying to add grid table in my div i cant like in example. Here is Ajax request:
function DataBaseTable(database,table) {
ShowDatabaseTable.open('get', 'lib/Databases.php?action=dbtable&db=' + database +'&table=' + table);
ShowDatabaseTable.onreadystatechange = function(){
if(ShowDatabaseTable.readyState == 4){
// create ActiveWidgets data model - XML-based table
var table = new Active.XML.Table;
// provide data URL
table.setURL("data/companies-simple.xml");
// start asyncronous data retrieval
table.request();
// 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.getElementById('c3').innerHTML = obj;
}
}
ShowDatabaseTable.send(null);
}
And here is that I see:
http://img266.imageshack.us/img266/6020/problemfr9.png
I have CSS:
div#content
{
border-top:2px solid #e0dfe3;
}
div#content div.cContent
{
border:1px solid #9d9da1;
margin-right:1px;
margin-bottom:1px;
padding-top:1px;
overflow:auto;
}
Have DIV in HTML:
<div id="c3" class="cContent">
<div>
<!-- Main page -->
</div>
</div>
I have xml from example:
companies-simple.xml
So then I trying to add grid table in my div i cant like in example. Here is Ajax request:
function DataBaseTable(database,table) {
ShowDatabaseTable.open('get', 'lib/Databases.php?action=dbtable&db=' + database +'&table=' + table);
ShowDatabaseTable.onreadystatechange = function(){
if(ShowDatabaseTable.readyState == 4){
// create ActiveWidgets data model - XML-based table
var table = new Active.XML.Table;
// provide data URL
table.setURL("data/companies-simple.xml");
// start asyncronous data retrieval
table.request();
// 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.getElementById('c3').innerHTML = obj;
}
}
ShowDatabaseTable.send(null);
}
And here is that I see:
http://img266.imageshack.us/img266/6020/problemfr9.png
Min2liz
November 11,