Results 1 to 2 of 2

Thread: How do I add a button to a grid action column ?

  1. #1
    Sencha User
    Join Date
    Jul 2012
    Vote Rating

    Default How do I add a button to a grid action column ?

    Can someone please tell me how to add a button to a grid column. Here is what I have done so far :

    In Project Inspector > click on MyGridPanel > in Config panel: Columns (press '+' to add new) > new Action Column > Set the icon

    So the icon shows up in the column. Great, but I can't click on it. How do I make it a button? I tried asking this in the general forum but I don't understand the answer

    I need to delete the row of the grid where the icon is clicked. thanks

  2. #2
    Sencha User
    Join Date
    May 2010
    Las Vegas, NV
    Vote Rating


    If you want to use a real Button, then you'll need to create a TemplateColumn, not an ActionColumn.

    Drag a TemplateColumn over, then add a tpl (template). In the tpl definition, add this:

    <tpl for="."><input type="button" value="ButtonText" onclick="myButtonOnClickFunction({recordField});"/></tpl>
    Obviously you'll have to define some global myButtonOnClickFunction to handle the click event.

    Now, if you want to use the ActionColumn....notice when you drag that over to your GridPanel it should create an ActionColumnItem object as well. So in there you set the icon class (iconCls) of the rendered "button". I suppose you could create your own graphic that looks like a button. You have to then add a handler to that ActionColumnItem for anything to happen when you click on it.

    Hope this helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts