[CLOSED] Icon in Grid Column header

  1. #1

    [CLOSED] Icon in Grid Column header

    Hi.

    I hace a Grid with a CommandColumn having Edit and Delete icons for each Row.
    In that's Column header I want to place an Add icon.

    Now I have a Js function call in an <a> tag displayed as plain text.

    <ext:CommandColumn Width="70" Align="Center" ButtonAlign="Center" Header="<a href='Javascript:btnAdd_Click();void(0);'>New</a>">
                                    <Commands>
                                        <ext:GridCommand Icon ="NoteEdit" CommandName="Edit"></ext:GridCommand>
                                        <ext:GridCommand Icon ="Delete" CommandName="Delete"></ext:GridCommand>
                                    </Commands>
                                </ext:CommandColumn>
    First of all I want to know if is there any way to render an Ext control in that header (so I don't have to add a plain <a> tag).

    If not, I would like to replace the "New" text with an Add icon.

    I tryed with ResourceManager.GetIconURL, RegisterIcon and so, but I can't get it to work.

    Thanks
    Regards
    Fernando

    NOTE: I see in Post preview that CODE tag parses wrong my code adding a '<b></b>' in the Js call I've never wrote.
    Last edited by Daniil; Mar 14, 2012 at 1:30 PM. Reason: [CLOSED]
  2. #2
    Quote Originally Posted by FAS View Post
    First of all I want to know if is there any way to render an Ext control in that header (so I don't have to add a plain <a> tag).
    No way, only additional rows like:
    https://examples1.ext.net/#/GridPane...ader/Overview/

    Quote Originally Posted by FAS View Post
    If not, I would like to replace the "New" text with an Add icon.
    This thread should help.
    http://forums.ext.net/showthread.php?10020

    Quote Originally Posted by FAS View Post
    NOTE: I see in Post preview that CODE tag parses wrong my code adding a '<b></b>' in the Js call I've never wrote.
    Don't worry, it's added by Forums software. Not sure why and don't know how to fix.
  3. #3
    Thanks Daniil.

    I didn't see that post althought I've been searching a lot. What do you have a personal index server in your pocket? ;-)

    Anyway, what I was trying to achieve is to embed the icon in an <a> tag to be clickable (It will open AddNew window).

    Also, I was trying to use one of your top of the art icons included in Ext. My problem was how to embed its Url in header.

    I say "was" cause I've already found the way to get that from codebehind in Form Load event.

    grdPhones.ColumnModel.Columns.Item(grdPhones.ColumnModel.Columns.Count - 1).Header = "<a href=""Javascript:btnAdd_Click();void(0);""><img alt=""Add new phone"" src=""" & ResourceManager1.GetIconUrl(Icon.Add) & """/></a>"
    Also I am disabling that Gird in View/Delete confirmation modes of the screen.

    As Grid can't be set as Readonly, and Disabling the whole Grid will set all contents hard to see, I disable all Commans (included header Add new command).

    Don't know if there is a better way to do that.

    Posting just in case it's a good approach and anyone looks for it.

    For Each mCom As GridCommand In CType(grdPhones.ColumnModel.Columns.Item(grdPhones.ColumnModel.Columns.Count - 1), CommandColumn).Commands
                mCom.Disabled = True
            Next
            grdPhones.ColumnModel.Columns.Item(grdPhones.ColumnModel.Columns.Count - 1).Header = grdPhones.ColumnModel.Columns.Item(grdPhones.ColumnModel.Columns.Count - 1).Header.Replace("btnAdd_Click()", "")
    Also adding some tags for widening this thread's coverage, and to confuse your personal index server ;-)

    Regards
    Fernando
  4. #4
    Quote Originally Posted by FAS View Post
    I didn't see that post althought I've been searching a lot. What do you have a personal index server in your pocket? ;-)
    No, just an experience :)

    Quote Originally Posted by FAS View Post
    Also I am disabling that Gird in View/Delete confirmation modes of the screen.

    As Grid can't be set as Readonly, and Disabling the whole Grid will set all contents hard to see, I disable all Commans (included header Add new command).
    If you'd start a new forum thread we could look into it.

Similar Threads

  1. Replies: 0
    Last Post: Feb 23, 2012, 5:05 AM
  2. [CLOSED] Icon in GridPanel Column Header
    By sadaf in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 13, 2011, 3:13 PM
  3. [CLOSED] [1.0] Possible to Add Icon to Grid Column Header?
    By bsnezw in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 14, 2010, 2:34 PM
  4. icon in the header column
    By maxdiable in forum 1.x Help
    Replies: 1
    Last Post: Jul 09, 2009, 10:30 AM

Tags for this Thread

Posting Permissions