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 8866873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:53:25+00:00 2026-06-14T16:53:25+00:00

In short, how can I show a drop down menu floating over a table

  • 0

In short, how can I show a drop down menu floating over a table and not rendered inside the table cell?

I am using this example code to show a drop down menu inside a table cell:

window.someObj.showSocs = function(index){
  var pSubMenu = new DropDownMenu({});
  pSubMenu.addChild(new MenuItem({
    label: "Cut",
    iconClass: "dijitEditorIcon dijitEditorIconCut"
  }));
  pSubMenu.addChild(new MenuItem({
    label: "Copy",
    iconClass: "dijitEditorIcon dijitEditorIconCopy"
  }));
  pSubMenu.addChild(new MenuItem({
    label: "Paste",
    iconClass: "dijitEditorIcon dijitEditorIconPaste"
  }));

  pSubMenu.placeAt("socs-" + index.toString());
  pSubMenu.startup();
}

where DropDownMenu is "dijit/DropDownMenu" and MenuItem is "dijit/MenuItem".

Then I am using this code to add a link to a table cell (it’s executed inside a dgrid renderCell function but I believe it is not relevant for this problem):

var link = document.createElement("a");
var linkText = "javascript:someObj.showSocs(" + index + ")";
link.setAttribute("href", linkText);
link.innerHTML = "DropNew";
td.appendChild(link);
td.setAttribute("id", "socs-" + index.toString());

Now when I click the link the dropdown is being rendered but inside the table cell, not over it. This causes the current table row to expand. I guess it’s down to some CSS properties that I can’t figure out. I am not overriding any CSS properties so I would expect the dropdown to be placed over the table instead of inside a cell automatically?

  • 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-06-14T16:53:25+00:00Added an answer on June 14, 2026 at 4:53 pm

    You place menu’s DOM node into the cell, so it stretches the cell. You can place the menu into <body> and position it absolutely with the help of dijit/place around the required node.

    I would use built-in functionality for context menus, e.g.:

    // var Menu = require("dijit/Menu");
    var menu = new Menu({
        leftClickToOpen: true,
        targetNodeIds: ["table1"],
        selector: "a.dropNew"
    });
    

    See it in action: http://jsfiddle.net/phusick/TBWXL/

    enter image description here

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

Sidebar

Related Questions

So, basically I have this select / drop down menu that I use AJAX
Can anyone show a short and simple code snippet? It should take the name
Short version: How can I map two columns from table A and B if
Someone can give me short explanation how to create bitmap runtime using GDI/GDI+ and
Short: Is there a way we can push to multiple remotes simultaneously using Github
Question : using jqgrid to show data of a table. table has foreign key
hello please me out while editing the drop down box value how we show
I am putting up a sort of drop down menu, obviuosly I'd like my
Short version: Can I grant access to external databases to a role? Long version:
Short Question: Can I specify wildcards for custom console folding? If so, what is

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.