jQWidgets Forums

jQuery UI Widgets Forums Grid Column right click

This topic contains 2 replies, has 2 voices, and was last updated by  programmister 6 years, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Column right click #102796

    programmister
    Participant

    Hello!

    Could you please explain how can I make a contextmenu on column (header) on right click and then define what the column is?

    Column right click #102802

    Peter Stoev
    Keymaster

    Hi programmister,

    Please, look at: https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/contextmenu.htm?material. The sample demonstrates how to display a context menu in jqxGrid. You can select with jQuery the column headers by using the $(“#grid .jqx-grid-column-header”) selector where #grid is the ID of the Grid. For Each element in that selection, you can use jQuery’s offset(), width() and height() methods to determine whether the event.pageX and event.pageY coordinates are inside. Then you can get the index of the clicked column. As you initialized the Grid passing a columns array, by using that index you can get the clicked column, too.

    Regards,
    Peter

    Column right click #102813

    programmister
    Participant

    thank you!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.