ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: arbyter on June 04, 2021, 03:53:15 pm

Title: contextmenu on tab
Post by: arbyter on June 04, 2021, 03:53:15 pm
hi Paramvir
i am trying to implement a context-Menu on Tab. I think, this is not basicly implemented (could not find in the API-Doc), but maybe you can give me a hint how to create it.
Title: Re: contextmenu on tab
Post by: paramvir on June 04, 2021, 10:11:48 pm
I'm not clear about which tab. Could you please share a screenshot.
Title: Re: contextmenu on tab
Post by: arbyter on June 07, 2021, 08:45:15 pm
I would like to add a contextmenu similar to on contextMenu.headItems right on the tab.

Title: Re: contextmenu on tab
Post by: paramvir on June 08, 2021, 09:14:57 am
Context menu is not supported outside the grid i.e., jQueryUI tabs.

In the upcoming version context menu would be supported on the integrated tabs as can be seen on the home page 2nd demo of spreadsheet.

https://paramquery.com/
Title: Re: contextmenu on tab
Post by: arbyter on June 08, 2021, 02:32:17 pm
thank you for your reply.
I cannot find "the home page 2nd demo of spreadsheet", your link leads just to the main page.
Title: Re: contextmenu on tab
Post by: arbyter on June 08, 2021, 03:08:04 pm
i am experimenting with contextmenu on grid: rightclick on the top-left grid corner does not deliver ui parameter. I would expect to have a grid-context ui there.
Title: Re: contextmenu on tab
Post by: paramvir on June 08, 2021, 06:56:39 pm
Please use context event.

https://paramquery.com/pro/api#event-context

ui argument has properties when context menu is activated on body cells, header cells or image, in other cases target of the context menu can be detected from evt.originalEvent.target.
Title: Re: contextmenu on tab
Post by: arbyter on June 09, 2021, 03:35:39 pm
thats what i am using. It delivers correct ui in cells, ui with -1 in rownumbers, but in the top left corner of the grid no ui is delivered.
Title: Re: contextmenu on tab
Post by: paramvir on June 09, 2021, 11:23:37 pm
That's right, ui object is empty in that region.

Please add miscItems in contextMenu option to define context menu on that region:

Code: [Select]
miscItems: function(evt, ui){
if( $(evt.originalEvent.target).is(".pq-grid-number-cell")){
//return menu items here.
return [{
    name: 'test',
    action: function(){
alert('test');
}
}]   
}
},