首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > XML SOAP >

gridpanel之4简单小例子(用XML做为数据源)

2012-10-30 
gridpanel之四简单小例子(用XML做为数据源)script typetext/javascriptfunction showUrl(value){retu

gridpanel之四简单小例子(用XML做为数据源)
<script type="text/javascript">
function showUrl(value)

{

return "<a href='http://"+value+"' target='_blank'>"+value+"</a>";

}

Ext.onReady(function(){

var store=new Ext.data.Store({

url:"hello.xml",

reader:new Ext.data.XmlReader({

record:"row"},

["id","name","organization","homepage"])

});

var colM=new Ext.grid.ColumnModel([{header:"项目名称",dataIndex:"name",sortable:true},

{header:"开发团队",dataIndex:"organization",sortable:true},

{header:"网址",dataIndex:"homepage",renderer:showUrl}]);

var grid = new Ext.grid.GridPanel({

renderTo:"hello",

title:"中国Java开源产品及团队",

height:200,

width:600,

cm:colM,

store:store,

autoExpandColumn:2

});

store.load();

});

</script>
</head>
  <body>
    <div id="hello"></div>
</body>
</html>

热点排行