Here's another one (workaround):
I think I got the tip from the forum, but can't find the thread...

<code>
  _handleDragStart : function (e)
  {
    // Allow drag only in pane area
    if (e.getTarget().getParent().classname != "qx.ui.layout.CanvasLayout") {
      return;
    }
    // ...
  }
</code>

/Kuddel


> Here is a workaround :
> 
>    __handleDragStart: function(e){
> 
>                var pageX = e.getPageX();
> 
>                var pageY = e.getPageY();
>                var scroller = table.getTablePaneScrollerAtPageX(pageX);
> 
>                if (!scroller) {
> 
>                    return; // avoid access violation
> 
>                  }
> 
>                var row = scroller._getRowForPagePos(pageX, pageY);
> 
>               
>                if (row == -1)
> 
>                { //ignore drag event on table header
> 
>                    e.stopPropagation();
>                    return;
> 
>                }   
>    }
> 
> 
> Romain FLIEDEL a écrit :
>> Hi All,
>>
>> I've noticed a problem with table column resizing in this case :
>> - table using drag and drop
>> - the table can be the source and the destination of the drag and drop
>>
>> When you start resizing a column it triggers a drag and drop event ...
>> is there a way not to trigger a dragstart event when moving over a
>> table header ?
>>
>> here is a code snippet (not tested) that should reproduce the problem
>>
>>     var tabModel = new qx.ui.table.model.Filtered();
>>
>>     tabModel.setColumns([ "col1", "col2", "col3", "col4", "col5" ]);
>>
>>     var table = new qx.ui.table.Table(tabModel);
>>
>>     table.setDropDataTypes(["table"]);
>>
>>     table.addEventListener("dragdrop", function(){}, this);
>>
>>     table.addEventListener("dragstart",   this.__handleDragStart,  this);
>>
>>     __handleDragStart: function(e){
>>
>>        e.addData("table", "");
>>
>>        e.addAction("move");
>>
>>        e.startDrag();
>>
>>     }
>>
>> You could ask what's the point of a drag and drop using the same
>> element, but in fact I was trying to handle row reordering by
>> selecting and row and moving it inside the table.
>> (actually this would be an interesting feature for qooxdoo 0.8)
>> [...]


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to