[CLOSED] Images in SplitButton Menu off

  1. #1

    [CLOSED] Images in SplitButton Menu off


    Hi, the images in my splitbutton menu are off when migrating to V1.0.
    See image for example...

    function AttendeeList(toolbar, attendees)
    {
        var template = '<a target=\"_top\" href="../../ContactPage.aspx?id={0}">{1}</a><br/>';
        var tmeplateUrl = '../../ContactPage.aspx?id={0}';
        var rolesButton = toolbar.items.get(0);
        rolesButton.menu = new Ext.menu.Menu({});
        var attendeesArr = attendees.split(',');
        rolesButton.setText(attendeesArr.length - 1);
        if (attendeesArr.length - 1 > 0)
        {
            for (x = 0; x <= attendeesArr.length - 2; x++)
            {
                var dt = attendeesArr[x];
                var d = dt.split(':');
                rolesButton.menu.addMenuItem({
                    text: String.format(template, d[0], d[1]),
                    url: String.format(tmeplateUrl, d[0]),
                    icon: '../../images/user.png',
                    handler: function(item)
                    {
                        window.parent.location.href = item.url;
                    }
                });
            }
        }
        else
        {
            toolbar.destroy();
        }
    }
    Grid Panel that calls method:
      <ext:GridPanel ID="GridPanel1" AutoDataBind="true" AutoExpandColumn="Title" runat="server"  height="650" StripeRows="true" TrackMouseOver="true" StoreID="Store1" header="false">
               
                        <LoadMask showmask="true" />
                        <ColumnModel id="ColumnModel1" runat="server">
                            <Columns>
                                <ext:Column ColumnID="Title" Header="Title" Width="200" Sortable="true" DataIndex="Title">       
                                      <Renderer Handler="return '<div class=rowCrmTitle>' + record.data.Title +  '
    ';" />
                                </ext:Column>
                                <ext:CommandColumn Header="Attendees" Width="50">
                                    <Commands>
                                        <ext:SplitCommand StandOut="false" >
                                            <Menu>
                                                <Items>
                                                </Items>
                                            </Menu>
                                        </ext:SplitCommand>
                                    </Commands>
                                    
                                </ext:CommandColumn>
                                <ext:Column ColumnID="CallType" Header="Call Type" Width="50" Align="center" Sortable="true" DataIndex="CallType">
                                    <Renderer Fn="GetCallIcon" />
                                </ext:Column>       
                                <ext:Column ColumnID="StartDateTime" Header="Start" Width="80" Sortable="true" DataIndex="StartDateTime">
                                    <Renderer Handler="return FormatDate(record.data.StartDateTime);" />
                                </ext:Column>
     </Columns>
                        </ColumnModel>
        </ext:GridPanel>

  2. #2

    RE: [CLOSED] Images in SplitButton Menu off

    Hi,

    I cannot reproduce it. Please popst full test sample
    Here is my test case
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.Store1.DataSource = new object[]
                {
                    new object[] { "3m Co"},
                    new object[] { "Alcoa Inc"},
                    new object[] { "Altria Group Inc"},
                    new object[] { "American Express Company"},
                    new object[] { "American International Group, Inc."},
                    new object[] { "AT&amp;T Inc."},
                    new object[] { "Boeing Co."},
                    new object[] { "Caterpillar Inc."},
                    new object[] { "Citigroup, Inc."},
                    new object[] { "E.I. du Pont de Nemours and Company"}
                };
    
                this.Store1.DataBind();
            }
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    
        <script type="text/javascript">   
            
            function AttendeeList(toolbar, record)
            {
                var template = '<a target=\"_top\" href="../../ContactPage.aspx?id={0}">{1}</a><br/>';
                var tmeplateUrl = '../../ContactPage.aspx?id={0}';
                var rolesButton = toolbar.items.get(0);
                rolesButton.menu = new Ext.menu.Menu({});
                rolesButton.setText("3");
                if (3 > 0)
                {
                    for (x = 0; x < 3; x++)
                    {
    
                        rolesButton.menu.addMenuItem({
                            text: "text"+x,
                            url: String.format(tmeplateUrl,x),
                            icon: 'add16.gif',
                            handler: function(item)
                            {
                                window.parent.location.href = item.url;
                            }
                        });
                    }
                }
                else
                {
                    toolbar.destroy();
                }
            }
        </script>
    
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Slate" />
            
            <ext:Store ID="Store1" runat="server">
                <Reader>
                    <ext:ArrayReader>
                        <Fields>
                            <ext:RecordField Name="company" />
                        </Fields>
                    </ext:ArrayReader>
                </Reader>
            </ext:Store>
     
            <ext:GridPanel 
                runat="server" 
                StoreID="Store1" 
                Title="Prepare toolbar" 
                Width="600" 
                Height="300"
                AutoExpandColumn="Company">
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column ColumnID="Company" Header="Company" Width="160" DataIndex="company" />
    
                        <ext:CommandColumn Width="110">
                            <Commands>
                                <ext:SplitCommand  Icon="NoteEdit" CommandName="Edit" Text="Edit" />
                            </Commands>
                                                   
                        </ext:CommandColumn>
                    </Columns>
                </ColumnModel>
            </ext:GridPanel>  
        </form>
    </body>
    </html>

Similar Threads

  1. [CLOSED] Splitbutton with Menu - Make the menu expand upwards?
    By rbarr in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 02, 2011, 1:18 PM
  2. Replies: 1
    Last Post: Feb 24, 2010, 4:38 PM
  3. [CLOSED] I can not show a vertical menu using images
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 31, 2010, 5:10 PM
  4. Flag images is not fit for menu item
    By Tom Zhang in forum 1.x Help
    Replies: 0
    Last Post: Jun 23, 2009, 2:07 PM
  5. [CLOSED] DateMenu in a SplitButton
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 15, 2008, 3:25 PM

Posting Permissions