PDA

View Full Version : Grid????????????



k_nishida
1 Dec 2009, 1:43 AM
???????????
Ext3.0?
GridPanel?????????????
????columns?????????
?????????????????????

???????????????????????????????
???????grid????????????????????????
GridPanel???????????????????
??????????????

nishi

Tommy1969
1 Dec 2009, 2:33 AM
????????css ? tr ???td ????????????????????

???????????????????~o)

k_nishida
1 Dec 2009, 6:32 PM
??????????????
?????????????????????????????
???height:14%?????????????????????????????
????????????????????????Window?????????????????
??????????????
??????????????????????


function set_height(val){
var s="<span style='height:200;'>";
s=s+val;
s=s+"</span>";
return(s);
}
var grid = new Ext.grid.GridPanel({
store: store
,columns: [
{id:'id',header: '?', width: '14%', sortable: true, dataIndex: 'd0',renderer: set_height}
,{header: '?', width: '14%', sortable: true, dataIndex: 'd1'}
,{header: '?', width: '14%', sortable: true, dataIndex: 'd2'}
,{header: '?', width: '14%', sortable: true, dataIndex: 'd3'}
,{header: '?', width: '14%', sortable: true, dataIndex: 'd4'}
,{header: '?', width: '14%', sortable: true, dataIndex: 'd5'}
,{header: '?', width: '14%', sortable: true, dataIndex: 'd6'}
]
,.....//????
});

Tommy1969
2 Dec 2009, 4:04 AM
% ???????????????????????

?????????????????????????resize ???????????????????????

k_nishida
6 Dec 2009, 9:47 PM
resize?????gridPanel????????????????????
gridPanel?redraw??????????????????????????????
columnModel?render???????????????
columnModel?render??????????????????????????

nishi

Tommy1969
7 Dec 2009, 9:16 AM
??????????????????????????????????????????

# ????????????????????????



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<link rel="stylesheet" type="text/css" href="ext-3.0.3/resources/css/ext-all.css" />
<script type="text/javascript" src="ext-3.0.3/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext-3.0.3/ext-all-debug.js"></script>

<script type="text/javascript">

Ext.onReady(function() {
var store = new Ext.data.ArrayStore({
fields: [
{name: 'code', type: 'int'},
{name: 'text', type: 'string'}
],
data: [
[1, '??????'],
[2, '?????'],
[3, '????'],
[4, '???']
]
});

var pnl = new Ext.grid.GridPanel({
store: store,
width: 200,
height: 150,
viewConfig: {forceFit: true},
columns: [
{header: '???', dataIndex: 'code'},
{header: '??', dataIndex: 'text'}
]
});

var bt1 = new Ext.Button({
text: '30px',
renderTo: 'bt1',
handler: function(btn, e) {
Ext.get('test1').select('div.x-grid3-row').applyStyles('height:30px;');
}
});

var bt1 = new Ext.Button({
text: '40px',
renderTo: 'bt2',
handler: function(btn, e) {
Ext.get('test1').select('div.x-grid3-row').applyStyles('height:40px;');
}
});

pnl.render('test1');
});

</script>

</head>
<body style="margin: 1cm;">
<div id="test1"></div>
<div id="bt1"></div>
<div id="bt2"></div>
</body>
</html>