Results 1 to 6 of 6

Thread: Duplicate button on Row Grid?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Jun 2011
    Vote Rating

    Default Answered: Duplicate button on Row Grid?


    I am using a grid and added one button at the last column. My purpose for this button is to allow user to open another window after clicking on this button. However, when ido a search grid or reset my grid to display all rows, i will see a duplicate button being rendered. Under the address column, i should only see one manage button.

    Any thoughts on how i can check if the button has been created and stop the renderer from creating again?


                    header: 'Address',
                    width: 90,
                    renderer: function(value, metadata, record) {
                        var divid="add_"+record.get("userid");
                        // executes after 2 seconds:
                        Ext.Function.defer(createGridButton, 500, this, ["Manage", divid, record,"icon-grid","Address"]);
                        return('<div id="' + divid + '"></div>');
    //Create button in grid cell
    function createGridButton(value, divid, record,iconname,buttonOwner) {
            new Ext.Button({
                id: divid,
                itemId: divid,
                text: value,
                iconCls: iconname,
                handler : function(btn, e) {
                    //E.g. add_123
                    var tmpUserID=divid.split("_")[1];
            }).render(document.body, divid);    
    function ManageExtWindow(extWinType,UserID){
            PopupCenter("listing.php?Listing=Address&src=User&srcid=" + UserID,"Manage Address",900,600);
        }else if(extWinType=="Telephone"){
            PopupCenter("listing.php?Listing=Telephone&src=User&srcid=" + UserID,"Manage Address",900,600);

  2. I believe that tobiu was suggesting that you use an Action Column rather than trying to inject a button like that.

    An alternative would be to use the Component Column UX:

    I believe your current implementation will suffer quite badly from leaks. Do you ever destroy those buttons (just because they are no longer on screen doesn't mean they have been destroyed)?

Posting Permissions

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