Check this out! http://tinyurl.com/3alrcam

Regards Sak

-----Ursprüngliche Nachricht-----
Von: Martin_GER [mailto:[email protected]] 
Gesendet: Mittwoch, 13. Oktober 2010 15:58
An: [email protected]
Betreff: Re: [qooxdoo-devel] Drag&Drop only by LIST


Thanks!
Now I have make a simple example with Drag&Drop in table. But the move of
lines is not working.
Can you or someone view the code?

Here the file "Application.js":
/* ************************************************************************

#asset(testdrag/*)

************************************************************************ */
qx.Class.define("testdrag.Application",
{
        extend : qx.application.Standalone,
        
        members :
        {
                main : function()
                {
                        this.base(arguments);

                        var doc = this.getRoot();
                        doc.add(this.__makeTransferTable(), {left: 10, top:
10});
                },
                __makeTransferTable : function() 
                {
                        var clazz = this; 
                        var tableModel =  new qx.ui.table.model.Simple(); 
                        
                        tableModel.setColumns([this.tr("Time"), 
                        this.tr("Vehicle"), this.tr("Driver"),
this.tr("Order No."), 
                        this.tr("Reference"), this.tr("Transfer"),
this.tr("Postalcode"), 
                        this.tr("City"), this.tr("Street"),
this.tr("Passengers"), 
                        this.tr("Person"), this.tr("Destination"),
this.tr("Fly Date"),
this.tr("Fly Time"), this.tr("Fly No."), this.tr("Comments")], 
                        ["trn_pickup_time", "trn_vehicle", "trn_driver", 
                        "trn_ord_id", "trn_ref_code", "trn_transfertype",
"trn_postalcode", 
                        "trn_city", "trn_street", "trn_passangers",
"trn_person",
"trn_destination", 
                        "trn_fly_date", "trn_fly_time", "trn_fly_no",
"trn_comment_dispo"]); 

                        // Instantiate a table 
                        var table = new qx.ui.table.Table(tableModel); 
                        table.set 
                        ({ 
                                decorator : "main", 
                                statusBarVisible : false, 
                                width: 500, 
                                height: 500 
                        }); 

                        var tcm = table.getTableColumnModel(); 
                        
                        //# Initialisiere Drag funtion 
                        table.setDraggable(true); 
                        table.setDroppable(true);
                        
                        table.addListener("dragstart", function(e) { 
                                e.addAction("copy"); 
                                e.addType("transfer"); 
                        }); 
                        
                        table.addListener("droprequest", function(e) 
                        { 
                                var action = e.getCurrentAction(); 
                                var type = e.getCurrentType(); 
                                var result =
clazz.getSelectedRowData(table)[0]; 
                                e.addData(type, result); 
                        }); 
                        
                        table.addListener("drop", function(e)
                        { 
                                if (e.supportsType("movetransfer")) 
                                {
                                        var data =
e.getData("movetransfer");
        
//clazz.tourTree.getDataModel().prune(data.nodeId, true); 
        
//clazz.tourTree.getDataModel().setData(); 
        
clazz.__rpc_removeTransferFromTour(data.trn_id);
                                } 
                        }); 

                        table.addListener("dragover", function(e) 
                        { 
                                if (e.supportsType("movetransfer"))
                                { 
                                        if (
clazz.getSelectedRowData(clazz.tourTree).length == 0) 
                                        { 
                                            e.preventDefault(); 
                                            return; 
                                        } 
                                        var node =
clazz.getSelectedRowData(clazz.tourTree)[0][0]; 
                        
                                        if (node.type == 2) 
                                        { 
                                                e.preventDefault(); 
                                                return; 
                                        }               
                } 
                else 
                { 
                        e.preventDefault(); 
                }
                        }); 

                        var tcm = table.getTableColumnModel(); 
                        tcm.setColumnWidth(5, 30); 
                        
                        var renderer = new
qx.ui.table.cellrenderer.Image(16, 16); 
                        table.getTableColumnModel().setDataCellRenderer(5,
renderer); 

                        var
rowData=[["1A","2","3","4","5","testdrag/test.png","7","8","9","10","11","12
","13","14","15","16"],
                                        
["1B","2","3","4","5","testdrag/test.png","7","8","9","10","11","12","13","1
4","15","16"],
                                        
["1C","2","3","4","5","testdrag/test.png","7","8","9","10","11","12","13","1
4","15","16"],
                                        
["1D","2","3","4","5","testdrag/test.png","7","8","9","10","11","12","13","1
4","15","16"]];
                        tableModel.setData(rowData);
                        
                        return table; 
                }
        }
});

-- 
View this message in context:
http://qooxdoo.678.n2.nabble.com/Drag-Drop-only-by-LIST-tp5622346p5631001.ht
ml
Sent from the qooxdoo mailing list archive at Nabble.com.

----------------------------------------------------------------------------
--
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to