On Tue, Jun 19, 2012 at 6:14 PM, Scott Chapman <[email protected]> wrote:
> Is there any examples of the correct use of mTableContextMenu? I can't
> find any.
The demobrowser example uses it:
http://demo.qooxdoo.org/devel/demobrowser/index.html?qxenv:demobrowser.withTests:true#table~Table_Context_Menu.html
There are a number of features of the mixin which are not used in that
example, though, so it's worth looking at the mixin documentation (or
better yet, the mixin source code) to see all of its features.
Derrell
>
>
> On Tue, Jun 19, 2012 at 5:29 AM, Derrell Lipman <
> [email protected]> wrote:
>
>> Scott, have a look at qx.ui.table.MTableContextMenu which allows you to
>> create a handler that generates the context menu.
>>
>> Note also that the act of right-clicking selects a row, so you may have
>> some trouble doing things differently depending on whether or not a row is
>> selected. You may need your own variables to track what "was" selected.
>>
>> Cheers,
>>
>> Derrell
>>
>> On Mon, Jun 18, 2012 at 4:55 PM, Scott Chapman <[email protected]> wrote:
>>
>>> This does it, but not the way I'd like. This is in my Table subclass:
>>>
>>> var that = this;
>>> this.__reQueue = function()
>>> {
>>> var selection = that.getSelectionModel().getSelectedRanges();
>>> if (selection.length !== 0)
>>> {
>>> console.log(selection[0].minIndex);
>>> }
>>> }
>>>
>>> this.__getContextMenu = function()
>>> {
>>> var menu = new qx.ui.menu.Menu;
>>> var exportCsvButton = new qx.ui.menu.Button("ReQueue");
>>> exportCsvButton.addListener("execute", this.__reQueue);
>>> menu.add(exportCsvButton);
>>> return menu;
>>> }
>>>
>>> this.setContextMenu(this.__getContextMenu());
>>>
>>> The __getContextMenu function is called when the table is instantiated,
>>> not when the right-click is done. I'd prefer it to be when the right-click
>>> is done so I could move the getSelectedRanges pieces into the
>>> __getContextMenu function and only show the menu if there's a row selected.
>>>
>>> Scott
>>>
>>>
>>>
>>> On Mon, Jun 18, 2012 at 12:54 PM, Derrell Lipman <
>>> [email protected]> wrote:
>>>
>>>> On Mon, Jun 18, 2012 at 3:35 PM, Scott Chapman <[email protected]>wrote:
>>>>
>>>>> Right clicking does not fire a cellClick or click event.
>>>>
>>>>
>>>> Scott, does this do what you're looking for?
>>>>
>>>> table.addListener(
>>>> "contextmenu",
>>>> function(e)
>>>> {
>>>> var selection = [];
>>>> table.getSelectionModel().iterateSelection(function(rowNumber)
>>>> {
>>>> selection.push(rowNumber + "");
>>>> });
>>>> alert("selected rows: " + selection.join(", "));
>>>> });
>>>>
>>>> Here's the playground sample:
>>>>
>>>> http://tinyurl.com/798ezvn
>>>>
>>>> Derrell
>>>>
>>>>
>>>>>
>>>>> On Sat, Jun 16, 2012 at 11:40 PM, Debora Lopez <[email protected]>wrote:
>>>>>
>>>>>> Hi Scott,
>>>>>>
>>>>>> This is one way to do it:
>>>>>>
>>>>>> 1. Get the focused Row on cell click
>>>>>> table.addListener("cellClick", *function*(event) {
>>>>>> * this*.__focusedRow = event.getRow();
>>>>>> ...
>>>>>> }
>>>>>>
>>>>>> 2. Then in
>>>>>> table.addListener("click", *function*(event) {
>>>>>> *if* (event.getButton() == "right") {
>>>>>> can use this.__focusedRow here
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> Dvora
>>>>>>
>>>>>>
>>>>>>
>>>>>> From: Scott Chapman <[email protected]>
>>>>>> To: qooxdoo Development <[email protected]>
>>>>>> Date: 16/06/2012 00:12
>>>>>> Subject: [qooxdoo-devel] How to get currently selected row in
>>>>>> table in a right-click menu context?
>>>>>> ------------------------------
>>>>>>
>>>>>>
>>>>>>
>>>>>> I need to be able to get the table row that is currently selected
>>>>>> within the right-click menu context. So there's not Event object to do
>>>>>> this
>>>>>> with, like I would in a cellDblclick for instance:
>>>>>>
>>>>>> var row = tableModel.getRowData(e.getRow());
>>>>>>
>>>>>> So what is the magic to get the currently selected row in a table in
>>>>>> the context of a menu?
>>>>>>
>>>>>> Thanks!
>>>>>> Scott
>>>>>> ------------------------------------------------------------------------------
>>>>>> Live Security Virtual Conference
>>>>>> Exclusive live event will cover all the ways today's security and
>>>>>> threat landscape has changed and how IT managers can respond.
>>>>>> Discussions
>>>>>> will include endpoint security, mobile security and the latest in
>>>>>> malware
>>>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>>>>> _______________________________________________
>>>>>> qooxdoo-devel mailing list
>>>>>> [email protected]
>>>>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Live Security Virtual Conference
>>>>>> Exclusive live event will cover all the ways today's security and
>>>>>> threat landscape has changed and how IT managers can respond.
>>>>>> Discussions
>>>>>> will include endpoint security, mobile security and the latest in
>>>>>> malware
>>>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>>>>> _______________________________________________
>>>>>> qooxdoo-devel mailing list
>>>>>> [email protected]
>>>>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Live Security Virtual Conference
>>>>> Exclusive live event will cover all the ways today's security and
>>>>> threat landscape has changed and how IT managers can respond.
>>>>> Discussions
>>>>> will include endpoint security, mobile security and the latest in
>>>>> malware
>>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>>>> _______________________________________________
>>>>> qooxdoo-devel mailing list
>>>>> [email protected]
>>>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>>>
>>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Live Security Virtual Conference
>>>> Exclusive live event will cover all the ways today's security and
>>>> threat landscape has changed and how IT managers can respond.
>>>> Discussions
>>>> will include endpoint security, mobile security and the latest in
>>>> malware
>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>>> _______________________________________________
>>>> qooxdoo-devel mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>>
>>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Live Security Virtual Conference
>>> Exclusive live event will cover all the ways today's security and
>>> threat landscape has changed and how IT managers can respond. Discussions
>>> will include endpoint security, mobile security and the latest in malware
>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>> _______________________________________________
>>> qooxdoo-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel