:: Forum >> Version 2 >>

this is a bug or my code is wrong?

<html>
<
head>
    <
title>ActiveWidgets Grid :: Examples</title>
    <
stylebodyhtml {margin:0pxpadding0pxoverflowhidden;} </style>

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

    <!-- 
grid format -->
    <
style>
        .
aw-grid-control {height100%; width100%; bordernonefontmenu;}

        .
aw-column-{width:  80px;}
        .
aw-column-{width200pxbackground-colorthreedlightshadow;}
        .
aw-column-{text-alignright;}
        .
aw-column-{text-alignright;}
        .
aw-column-{text-alignright;}

        .
aw-grid-cell {border-right1px solid threedshadow;}
        .
aw-grid-row {border-bottom1px solid threedlightshadow;}
    </
style>
</
head>
<
body>
    <
script>

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

    
//    define data formats
    
var str = new AW.Formats.String;
    var 
num = new AW.Formats.Number;

    
table.setFormats([strstrnumnumnum]);

    
//    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 AW.UI.Grid;

    
obj.setColumnCount(5);

    
//    provide column labels
    
obj.setHeaderText(columns);

    
//    enable row selectors
    
obj.setSelectorVisible(true);
    
obj.setSelectorText(function(i){return this.getRowPosition(i)});
    
obj.setSelectorWidth(25);

    
//    set row selection
    
obj.setSelectionMode("single-row");

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

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

             
    
var panel = new AW.HTML.SPAN;
    
panel.setContent("grid",obj);
    
document.write(panel);

    </
script>
</
body>
</
html>
 
xiaohong
Thursday, December 22, 2005
It would be nice if you could tell us what you think is wrong. You don't walk into the doctors office and have your first comment be "what's wrong with me" before telling the doctor what your symptoms are.
Jim Hunter
Thursday, December 22, 2005
you may copy the code and run in browser,click the row and the row will missing,but i change this
panel.setContent("grid",obj); 
 
to
panel.setContent("grid",obj.toString()); 
 
and it will work well
xiaohong
Thursday, December 22, 2005
my browser is ie6
xiaohong
Thursday, December 22, 2005



This topic is archived.

Back to support forum

Forum search