Ext4.2:这段代码在IE8中无法正常运行,有什么解决方案吗,关于itemmouseup事件的
<html>
<head>
<link rel="stylesheet" type="text/css" href="./ExtJS4/resources/css/ext-all.css" />
<script type="text/javascript" src="./ExtJS4/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function() {
var tree = new Ext.tree.TreePanel({
id : 'tree',
viewConfig : {
plugins : {
ddGroup : 'demo',
ptype : 'treeviewdragdrop',
enableDrop : false
}
},
store : new Ext.data.TreeStore({
root : {
text : 'Root',
children : [
{text : 'Son1',leaf : true},
{text : 'Son2',leaf : true},
{text : 'Son3',leaf : true}
]
}
})
});
tree.render('tree');
tree.getRootNode().expand(false, true);
var columns = [
{header : '编号',dataIndex : 'id'},
{header : '名称',dataIndex : 'name'}
];
var data = [
[ '1' ],
[ '2' ],
[ '3' ],
[ '4' ],
[ '5' ]
];
var store = new Ext.data.ArrayStore({
data : data,
fields : [ {name : 'id'}, {name : 'name'}]
});
store.load();
var tmp="";
var grid = new Ext.grid.GridPanel({
id:'grid',
autoHeight : true,
renderTo : 'grid',
store : store,
columns : columns,
listeners:
{
'itemmouseup':function(obj,record,item,index,e,eOpts)
{
grid.getStore().getAt(index).set('name',tmp);
}
}
});
(function(){
var gridEl=Ext.getCmp('grid').body.dom;
var gridDropTarget=Ext.create('Ext.dd.DropTarget',gridEl,{
ddGroup:'demo',
notifyEnter:function(source,e,data){
data.records[0].get("text");
tmp=data.records[0].get("text");
}
});
})();
});
</script>
</head>
<body>
<div id="tree"></div>
<div id="grid"></div>
</body>
</html>
在IE中有个bug,就是必须在表格上按下鼠标,并在表格上松开鼠标,才能触发Grid的itemmouseup事件,但是我这里是在表格外按下鼠标,仅仅是在表格上松开鼠标,在IE8中就无法触发这个itemmouseup事件了,有什么解决办法吗?
pxzphb
10 years, 5 months ago