Hi again,
This is my proposal for a permanent fix. It's also attached to Bug 4568[3].
We can of cause discuss about the name of the property/flag
or the init-value... ;)
But in general I would like to see this kind of solution.
Cheers,
Peter
[3] Bug : http://bugzilla.qooxdoo.org/show_bug.cgi?id=4568
Attachment: http://bugzilla.qooxdoo.org/attachment.cgi?id=869
> Hi there,
>
> for a quick fix you can apply the attached patch to
> "qx.ui.table.MTableContextMenu".
>
> But for a permanent fix I would like to have this behavior configurable...
>
> Reason:
> In my application I can start with an empty table and I still have to be
> able to open the context menu there, because in the context menu there's a
> point like "add one row" ;)
>
> So I recommend that the behavior is controlled by something like
> "showMenuOnEmptyRow"...
>
> For now I will attach the patch to the bug[1] and possibly add a proposal for
> my request, too.
>
>
> Cheers,
> Peter
>
> P.S.: Why did I respond? Because I requested these[2] ;)
> -------------
> [1] http://bugzilla.qooxdoo.org/show_bug.cgi?id=4568
>
> [2] http://bugzilla.qooxdoo.org/show_bug.cgi?id=4065,
> http://bugzilla.qooxdoo.org/show_bug.cgi?id=4066,
> http://bugzilla.qooxdoo.org/show_bug.cgi?id=4067
>
>
>
> On 2011-01-20 16:30 Martin_GER wrote:
>> >
>> > Bug 4568 is online
>> >
>> > Thanks!
Index: MTableContextMenu.js
===================================================================
--- MTableContextMenu.js (Revision 24612)
+++ MTableContextMenu.js (Arbeitskopie)
@@ -44,9 +44,17 @@
contextMenu = null;
}
+ var col = e.getColumn();
+ var row = e.getRow();
+
+ // If we shouldn't display the context menu in the empty space, we have
+ // nothing to do.
+ if (row === null && ! this.isShowMenuOnEmptyRows()) {
+ return;
+ }
+
// Get the context menu handler for the column on which the context
// menu request was issued.
- var col = e.getColumn();
var contextMenuHandler = this.getContextMenuHandler(col);
// If there's no context menu handler for this column, we have nothing
@@ -77,7 +85,7 @@
// Call the context menu handler for this column.
var bShowContextMenu = contextMenuHandler.call(handlerContext,
col,
- e.getRow(),
+ row,
this,
tableModel,
contextMenu
@@ -102,6 +110,16 @@
this.__contextMenuHandlerContext = [ ];
},
+ properties :
+ {
+ /** Whether to display the context menu even on empty rows (grey area) */
+ showMenuOnEmptyRows : {
+ init : true,
+ check : "Boolean",
+ nullable : false
+ }
+ },
+
members :
{
__contextMenuHandler : null,
------------------------------------------------------------------------------
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