jQWidgets Forums
jQuery UI Widgets › Forums › Navigation › Menu, Context Menu › Menu appears behind Grid
Tagged: JavaScript Menu, jQuery Menu, jqxMenu, Menu
This topic contains 3 replies, has 2 voices, and was last updated by milen 12 years, 8 months ago.
-
AuthorMenu appears behind Grid Posts
-
I have created a web app that uses both the jqxMenu and the jqxGrid. The menu is positioned above the grid. The menu items display behind the grid. I have tried to adjust the z-index values for the menu and the grid. It doesn’t help.
Hi grozavule,
I have tried to reproduce the reported behavior with jqxMenu and jqxGrid, but without avail. Do you use the latest version of jQWidgets and jQuery? Which browser do you use? Could you send us a sample which illustrates the issue?
Here’s my test code:
<!DOCTYPE html><html lang="en"><head> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.7.2.min.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxgrid.columnsresize.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script> <script type="text/javascript" src="../../scripts/gettheme.js"></script> <script type="text/javascript"> $(document).ready(function () { var theme = getTheme(); // prepare the data var data = new Array(); var firstNames = [ "Andrew", "Nancy", "Shelley", "Regina", "Yoshi", "Antoni", "Mayumi", "Ian", "Peter", "Lars", "Petra", "Martin", "Sven", "Elio", "Beate", "Cheryl", "Michael", "Guylene" ]; var lastNames = [ "Fuller", "Davolio", "Burke", "Murphy", "Nagase", "Saavedra", "Ohno", "Devling", "Wilson", "Peterson", "Winkler", "Bein", "Petersen", "Rossi", "Vileid", "Saylor", "Bjorn", "Nodier" ]; var productNames = [ "Black Tea", "Green Tea", "Caffe Espresso", "Doubleshot Espresso", "Caffe Latte", "White Chocolate Mocha", "Cramel Latte", "Caffe Americano", "Cappuccino", "Espresso Truffle", "Espresso con Panna", "Peppermint Mocha Twist" ]; var priceValues = [ "2.25", "1.5", "3.0", "3.3", "4.5", "3.6", "3.8", "2.5", "5.0", "1.75", "3.25", "4.0" ]; for (var i = 0; i < 200; i++) { var row = {}; var productindex = Math.floor(Math.random() * productNames.length); var price = parseFloat(priceValues[productindex]); var quantity = 1 + Math.round(Math.random() * 10); row["firstname"] = firstNames[Math.floor(Math.random() * firstNames.length)]; row["lastname"] = lastNames[Math.floor(Math.random() * lastNames.length)]; row["productname"] = productNames[productindex]; row["price"] = price; row["quantity"] = quantity; row["total"] = price * quantity; data[i] = row; } var source = { localdata: data, datatype: "array" }; var dataAdapter = new $.jqx.dataAdapter(source); $("#jqxMenu").jqxMenu({ width: 700, height: 35 }); $("#jqxgrid").jqxGrid( { width: 700, source: dataAdapter, theme: theme, columnsresize: true, columns: [ { text: 'First Name', dataField: 'firstname', width: 100 }, { text: 'Last Name', dataField: 'lastname', width: 100 }, { text: 'Product', dataField: 'productname', width: 180 }, { text: 'Quantity', dataField: 'quantity', width: 80, cellsalign: 'right' }, { text: 'Unit Price', dataField: 'price', width: 90, cellsalign: 'right', cellsformat: 'c2' }, { text: 'Total', dataField: 'total', cellsalign: 'right', minwidth: 100, cellsformat: 'c2' } ] }); }); </script></head><body class='default'> <div id='jqxMenu' margin-left: 20px;'> <ul> <li><a href="#Home">Home</a></li> <li>Solutions <ul style='width: 250px;'> <li><a href="#Education">Education</a></li> <li><a href="#Financial">Financial services</a></li> <li><a href="#Government">Government</a></li> <li><a href="#Manufacturing">Manufacturing</a></li> <li type='separator'></li> <li>Software Solutions <ul style='width: 220px;'> <li><a href="#ConsumerPhoto">Consumer photo and video</a></li> <li><a href="#Mobile">Mobile</a></li> <li><a href="#RIA">Rich Internet applications</a></li> <li><a href="#TechnicalCommunication">Technical communication</a></li> <li><a href="#Training">Training and eLearning</a></li> <li><a href="#WebConferencing">Web conferencing</a></li> </ul> </li> <li><a href="#">All industries and solutions</a></li> </ul> </li> <li>Products <ul> <li><a href="#PCProducts">PC products</a></li> <li><a href="#MobileProducts">Mobile products</a></li> <li><a href="#AllProducts">All products</a></li> </ul> </li> <li>Support <ul style='width: 200px;'> <li><a href="#SupportHome">Support home</a></li> <li><a href="#CustomerService">Customer Service</a></li> <li><a href="#KB">Knowledge base</a></li> <li><a href="#Books">Books</a></li> <li><a href="#Training">Training and certification</a></li> <li><a href="#SupportPrograms">Support programs</a></li> <li><a href="#Forums">Forums</a></li> <li><a href="#Documentation">Documentation</a></li> <li><a href="#Updates">Updates</a></li> </ul> </li> <li>Communities <ul style='width: 200px;'> <li><a href="#Designers">Designers</a></li> <li><a href="#Developers">Developers</a></li> <li><a href="#Educators">Educators and students</a></li> <li><a href="#Partners">Partners</a></li> <li type='separator'></li> <li>By resource <ul> <li><a href="#Labs">Labs</a></li> <li><a href="#TV">TV</a></li> <li><a href="#Forums">Forums</a></li> <li><a href="#Exchange">Exchange</a></li> <li><a href="#Blogs">Blogs</a></li> <li><a href="#Experience Design">Experience Design</a></li> </ul> </li> </ul> </li> <li>Company <ul style='width: 180px;'> <li><a href="#About">About Us</a></li> <li><a href="#Press">Press</a></li> <li><a href="#Investor">Investor Relations</a></li> <li><a href="#CorporateAffairs">Corporate Affairs</a></li> <li><a href="#Careers">Careers</a></li> <li><a href="#Showcase">Showcase</a></li> <li><a href="#Events">Events</a></li> <li><a href="#ContactUs">Contact Us</a></li> <li><a href="#Become an affiliate">Become an affiliate</a></li> </ul> </li> </ul> </div> <div id='jqxWidget'> <div id="jqxgrid"></div> </div></body></html>
Looking forward to your reply.
Best Regards,
Milen IvanovjQWidgets Team
http://www.jqwidgets.comMilen,
Thank you for looking into this for me. To my knowledge, I am using the latest versions of jqxMenu and jqxGrid. (I downloaded them two weeks ago).
I think I may have solved the issue. I noticed that each cell in the grid was being dynamically assigned a z-index based on how many records were in the grid. My grid has 26 columns and 181 records in it. The first row was assigned a z-index of 1118. The menu was assigned a z-index of 1000. I adjusted the menu’s assigned z-index in jqxmenu.js. This took care of the problem.
Thanks again.
Hi grozavule,
Thanks for the feedback.
The latest version is jQWidgets 2.3 and is from 17-July. For more details about the new version, see here.
Best Regards,
Milen IvanovjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.