Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Richard on Jul 11, 2008 06:09
open dhtmlx forum
Removing icon padding

Hi,

I am using v.1.0 build 71114

I have an xml loaded menu that is a simple menu with no icons beside any of the options. I notice that I am still getting the space padding to the left for possible icons and I want to remove this. How do I configure the menubar so it doesn't layout menus with that padding?

a rough illustration:

<code>
+-----------------------+
+ Option 1 +
+ Option 2 +
+ Option 3 +
+ +
+-----------------------+

</code>
Answer posted by Support on Jul 11, 2008 07:03
In XML of menu, next attribute can be used

<menu withoutImages="true">
    ....

Full list of possible options can be checked at
    http://dhtmlx.com/docs/products/docsExplorer/doc/dhtmlxxml/index.html#dhtmlx_xml
Answer posted by Richard on Jul 11, 2008 08:28
I apologize, I should have mentioned that I already had that attribute specified.

Here is what I had:

<menu name="Order Workdesk" width="1005" height="20" absolutePosition="auto" menuAlign="left" mode="classic" withoutImages="1">

After your reply, I changed the value from "1" to "true" but I still have a block of space to the left of each menu option. Here is one of the menu options for reference:

<MenuItem name="Open" src="" height="25" width="25" id="file_open" />

All of the menu items look similar to this.

Answer posted by Support on Jul 14, 2008 04:12
Event with images disabled, menu items still have some padding, which may cause issue in your case.
You can remove or decrease padding value in dhtmlxmenu.css

.defaultMenuText{
    font:12px Arial,sans-serif;
    padding-left:10px;   // <= this is it!
    padding-right:5px;
    text-align:left;
}
Answer posted by Richard on Jul 14, 2008 10:37
Actually, that didn't work but it led me on a path of digging into your code and I found this line of code in the dhtmlXMenuItemObject constructor:

            image_size=parseInt(image_size)||18;

When I changed this line to:

            image_size=parseInt(image_size)||5;

the padding was as I wanted it. 

I started to delve further to find the disconnect in the code between this attribute and withoutImages but I have deadlines too! ;)

Thanks guys!
Answer posted by Support on Jul 15, 2008 02:29
It's pretty strange, because when withoutImages attribute set the menu item constructor will always receive an empty value for image src, and by existing logic the TD container, where image placed will have style=display:none.
Maybe you have some global style, which redefine display property for TD element.