Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 434365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:16:02+00:00 2026-05-12T20:16:02+00:00

This example is simplified a bit, but in my ASP.NET web page in my

  • 0

This example is simplified a bit, but in my ASP.NET web page in my c#/jquery code I am using a right hand context menu that displays ‘rightMenu’ when a right mouse is clicked.

$(document).ready(function() {

    $(".RH_signoffrow td").contextMenu({
        menu: 'rightMenu'
    },
        function(action, el, pos) {

        var mykey = getkeyforitem(el);
        mykey = "Details|" + mykey;

       alert(
            'Action: ' + action + '\n\n' +
            'Key is: ' + mykey 
        );
        if(action == "details"){
            trigger_details_panel(mykey);
        }

    });

};


//for any td in the right hand side - get its row key
function getkeyforitem(el){
   var mykey = $(el).parent().find('.hiddenrowkey').text();
//   alert(
//        'Internal getkeyforitem Call' + '\n\n' +
//        'Key is: ' + mykey 
//    );
    return mykey; 
};

The callback of the menu passes back the element that was clicked, and that can be used to pull the keydata out of the current table row. Once I have that keydata, I can use it to call the real function I was after:
trigger_details_panel(mykey).

This works fine if I only want to use the right mouse, but I want to include an image in some of the rows, so that when the image is clicked, it produces the same effect,as the right mouse menu selection.

I am not sure how to accomplish that cleanly.

I can include an image that links to javascript in my page…

  <asp:ImageButton ID="imgDetails" runat="server" ToolTip="Show Details"
  ImageUrl="./images/details.gif" OnClientClick="showdetailsclicked();return
  false;"></asp:ImageButton>

But how can I get it to call the code:

getkeyforitem(el);

Or at least know the element (el) it belongs to? It seems like there should be a way to use the (this) pointer to get at what I want – but I don’t see it.
Am I just missing a more straightforward way to accomplish the whole problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T20:16:02+00:00Added an answer on May 12, 2026 at 8:16 pm

    If you replace the line:

    var mykey = $(el).parent().find('.hiddenrowkey').text();
    

    with

    var mykey = $(el).parents("tr").find('.hiddenrowkey').text();
    

    Then you can use this function to find the hidden rowkey from any element in the row.

    Edit after comment:

    You were right about using this. I’d probably do something like:

    function showdetailsclicked(){ var rowKey = getkeyforitem(this);}
    

    However, Im not sure if theres some issue with ASP, I doubt it, but you never know… You may have to do something like:

    <asp:ImageButton ID="imgDetails" runat="server" ToolTip="Show Details"
      ImageUrl="./images/details.gif" OnClientClick="showdetailsclicked(this);return
      false;"></asp:ImageButton>
    
    function showdetailsclicked(el){ var rowKey = getkeyforitem(el);}
    

    Hope that helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is this example code, but then it starts talking about millisecond / nanosecond
<h:commandLink id=#{id} value=#{value} action=#{actionBean.getAction} onclick=alert(this);/> In the previous simplified example, the 'this' keyword used
This example is from php.net: <?php function Test() { static $a = 0; echo
Given this example: <img class=a /> <img /> <img class=a /> <img class=a id=active
Consider this example table (assuming SQL Server 2005): create table product_bill_of_materials ( parent_product_id int
Consider this example (typical in OOP books): I have an Animal class, where each
Following this example, I can list all elements into a pdf file import pyPdf
In this example the .Stub returns a new memory stream. The same memory stream
Please consider this example class: [Serializable] public class SomeClass { private DateTime _SomeDateTime; public
Trying to get this example working from http://www.munna.shatkotha.com/blog/post/2008/10/26/Light-box-effect-with-WPF.aspx However, I can't seem to get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.