PDA

View Full Version : Collapsible grid DragDrop



aiky.cc
21 Feb 2013, 7:35 AM
For grid collapsible:false dragging grid row working good.
But for grid collapsible:true firebug says:

TypeError: Ext.fly(...) is null
http://[path]/ext-all.js
Line 104272

Build date: 2012-10-25 15:13:53 (240477695016a85fb9ed1098fd5f8e116327fcc3)


104270 getPosition: function(e, node) {
104271 var y = e.getXY()[1],
104272 region = Ext.fly(node).getRegion(),
104273 pos;
104274 if ((region.bottom - y) >= (region.bottom - region.top) / 2) {
104275 pos = "before";
104276 } else {
104277 pos = "after";
104278 }
104279 return pos;
104280 }


Is this a bug?

Update(March 1, 2103)
Store load event fires before grid update.
So datachanged event solving this problem.

scottmartin
21 Feb 2013, 9:08 AM
Have you inspected the values in getPosition?
Are you trying to drop to a grid/view that is not visible? ie, the grid title and not view?

There is no node, hence the error..

Scott.

aiky.cc
21 Feb 2013, 9:24 AM
Error on just dragging up row from grid.
One grid, difference for collapsible only.



var store = Ext.create('Ext.data.Store',{
'autoLoad':true,
'fields':[...],
'proxy':{
'type':'ajax',
'url':'url.php',
'reader':{
'type':'json',
'idProperty':'id'
},
'extraParams':{..},
'groupParam':undefined,
'pageParam':undefined,
'startParam':undefined,
'sortParam':undefined,
'limitParam': undefined
},
'listeners':{
'load':function(store){
var ln = store.count();
if(ln > 0) grid.expand();
else grid.collapse();
}
}
});

var grid = Ext.create('Ext.grid.Panel',{
'title':'title',
'layout':{
'type':'fit',
'align':'stretch'
},
'selModel':Ext.create('Ext.selection.RowModel',{
'mode':'multi'
}),
'autoScroll':true,
'collapsible':true,
'collapsed':true,
'height':250,
'minHeight':250,
'flex':.25,
'border':0,
'style':{'border-bottom':'1px solid #99bce8'},
'store':store,
'bbar':{
'items':[{
'iconCls':'x-tbar-loading',
'handler':function(){
store.load();
}
}]
},
'columns':[...],
'viewConfig':{
'plugins':[
Ext.create('Ext.grid.plugin.DragDrop',{
'ddGroup':'grid2tree'
})
]
},
});

aiky.cc
21 Feb 2013, 9:44 AM
Grid is created with collapsed:true
On grid store load if rows count > 0 grid expand.
So after expand I have this error.

If I not use collapsible and collapsed there no error.

scottmartin
21 Feb 2013, 10:20 AM
I see you created a ticket: ticket-11141

Did you want to continue this in the portal?

Scott.

aiky.cc
21 Feb 2013, 11:36 AM
I need fix it as soon as possible.

scottmartin
21 Feb 2013, 11:41 AM
I will divert this to support ticket since it gets assigned. No need to duplicate efforts.

Scott.

aiky.cc
21 Feb 2013, 12:02 PM
Ok, sounds good.