Hi,
I have integrated the trunk version (and use setContextMenuHandler), but a
mistake is still propagated. When I first click in the gray area, the menu
appears. Only after the first click on a line, the menu is not longer
displayed.
Probably it is still a bug? Is this right? Can someone help?

Here the example:

the name: "tabledemo"

"Application.js":

/* ************************************************************************
#asset(tabledemo/*)
************************************************************************ */
qx.Class.define("tabledemo.Application",
{
        extend : qx.application.Standalone,
        
        members :
        {
                main : function()
                {
                        // Call super class
                        this.base(arguments);
                        
                        var tabledemo_programm = new tabledemo.CreateTable();  
                        this.getRoot().add(tabledemo_programm, {edge: 0});      
                }
        }
});

"CreateTable.js":

/* ************************************************************************
#asset(tabledemo/*)
************************************************************************ */
qx.Class.define("tabledemo.CreateTable",
{
        extend : qx.ui.container.Composite,
        
        construct : function()
        {
                qx.Class.include(qx.ui.table.Table, 
qx.ui.table.MTableContextMenu);
                
                this.base(arguments);
                
                var haupt_layout = new qx.ui.layout.VBox();
                haupt_layout.setSeparator("separator-vertical");
                this.setLayout(haupt_layout);
                this.setBackgroundColor("#ffffff");
                
                var container1 = this.create_container1();
                this.add(container1);
                this.setNativeContextMenu(true);
        },
        members :
        {
                create_container1 : function()
                {
                        //############################################
                        //hier: Programm-Container mit Menue erstellen
                        //############################################
                        var layout = new qx.ui.layout.VBox();
                        var borderColor = "#cccccc";  
                        var border_container = new qx.ui.decoration.Single(1, 
"solid",
borderColor).set({ }); 
                        var container = new 
qx.ui.container.Composite(layout).set({
                                backgroundColor: "#cccccc",
                                decorator: border_container
                        });  

                        container.add(this.create_table(), { flex: 1 });
                        
                        return container;
                },
                create_table : function()
                {
                        var rowData = 
[[1,11,111,1111],[2,22,222,2222],[3,33,333,3333]];
                        
                        var tableModel = this._tableModel = new 
qx.ui.table.model.Simple();
                        tableModel.setColumns(["number 1", "number 2", "number 
3", "number 4"]);
                        tableModel.setData(rowData);

                        var table = new qx.ui.table.Table(tableModel);
                        
                        table.set({
                                width: 600,
                                height: 400,
                                decorator : null
                        });
                        table.setContextMenuHandler(2, this._contextMenu);
                        table.setContextMenuHandler(3, this._contextMenu);

                        return table;
                },
                _contextMenu : function(col,
                        row,
                        table,
                        dataModel,
                        contextMenu)
                {
                        var button1 = new qx.ui.menu.Button("button 1");
                        var button2 = new qx.ui.menu.Button("button 2");
                        var button3 = new qx.ui.menu.Button("button 3");
                        
                        contextMenu.add(button1);
                        contextMenu.add(button2);
                        contextMenu.add(button3);

                        return true;
                }
        }
});


Thanks!
Martin

-- 
View this message in context: 
http://qooxdoo.678.n2.nabble.com/table-contextmenu-displayed-only-on-data-lines-tp5938668p5943379.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to