1

I am using JQuery Context Menu plugin to show custom context menu Link Here

I am using select to show some options to filter in menu items as follows

var filterList={0:'title1',1:'title2',2:'title3'};

menuItems = {
    "true": { name: "Sort Ascending", icon: "asc" },
    "false": { name: "Sort Descending", icon: "desc" },
    "sep1": "----------------",
    "Clear": { name: "Clear filter on"+columnName, icon: "clear", disabled: false },
    select: {
        name: "Filter " + columnName, type: 'select', options: filterList,
        events: {
            change: function () {
                **//I want selected option text value here but dont know how??**
            }
        }
    }
};

how can i get value there on change function

2 Answers 2

3
function (e) {e.target.options[e.target.selectedIndex].value} or

$(e.target).find(":selected").val();
Sign up to request clarification or add additional context in comments.

Comments

0

Next time, try to explain your question better.

I don't know a lot of jQuery Context Menu, but for what I know, you can do something like this:

    function (e) {e.target.options[e.target.selectedIndex].value}

Comment here if this code doesn't work for you. I will try help.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.