PDA

View Full Version : Drag & Drop ? CheckboxSelectionModel ???



Tommy1969
3 Oct 2009, 9:20 AM
GridPanel ? Drag & Drop ???????????CheckboxSelectionModel ???????????????:((

# ?????????????????????Safari4 & Firefox 3.5

??????????????????? :-?



<!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" />
<script type="text/javascript" src="http://extjs.cachefly.net/builds/ext-cdn-2060.js"></script>
<link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.3.0/resources/css/ext-all.css" />
<script type="text/javascript">

Ext.onReady(function() {
var store = new Ext.data.SimpleStore({
fields: ['name'],
data: [['????'],['????'],['????????']]
});

var sm1 = new Ext.grid.CheckboxSelectionModel();
var sm2 = new Ext.grid.CheckboxSelectionModel();

var panel1 = new Ext.grid.GridPanel({
height: 200,
width: 300,
store: store,
viewConfig: {forceFit: true},
sm: sm1,
columns: [sm1, {header:'??', dataIndex:'name'}],
enableDragDrop: true // ???????
});

var panel2 = new Ext.grid.GridPanel({
height: 200,
width: 300,
store: store,
viewConfig: {forceFit: true},
sm: sm2,
columns: [sm2, {header:'??', dataIndex:'name'}]
});

panel1.render('test1');
panel2.render('test2');
});

</script>
</head>
<body>
<div id="test1"></div>
<div id="test2"></div>
</body>
</html>


???????????????????????m(__)m

yuki
6 Oct 2009, 7:17 PM
3.0???????:)???????????????????????????????????

yuki
8 Oct 2009, 12:17 AM
???????????FireFox3.0?Ext JS 2.3.0?????


Ext.override(Ext.grid.CheckboxSelectionModel, {
handleMouseDown : function(g, rowIndex, e){
if((g.enableDragDrop || g.enableDrag) && e.getTarget().className == 'x-grid3-row-checker'){
return;
}else{
Ext.grid.CheckboxSelectionModel.superclass.handleMouseDown.apply(this, arguments);
}
}
});

/*
Ext.override(Ext.grid.GridDragZone, {
getDragData : function(e){
var t = Ext.lib.Event.getTarget(e);
var rowIndex = this.view.findRowIndex(t);
if(rowIndex !== false){
var sm = this.grid.selModel;
if(!sm.isSelected(rowIndex) || e.hasModifier() || sm.getCount() >1){
sm.handleMouseDown(this.grid, rowIndex, e);
}
return {grid: this.grid, ddel: this.ddel, rowIndex: rowIndex, selections:sm.getSelections()};
}
return false;
}
});*/

?????????????????CheckboxSelectionModel????????????????????????????????????????????????????MouseDown??????????????????????

?????????????????????????????????????????????????????????????????????????????????

????????;)

??????????????

Tommy1969
8 Oct 2009, 8:01 PM
???????????
???????m(__)m