Results 1 to 7 of 7

Thread: No buttons in row editing?

  1. #1
    Sencha Premium Member
    Join Date
    Jul 2011
    Posts
    119
    Vote Rating
    5
      0  

    Default No buttons in row editing?

    Is there a way to hide the update / cancel buttons in grid row editing? I just want to save the changes when the user scrolls off.

    Thanks

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,136
    Vote Rating
    1429
      0  

    Default

    There is no config You could build your own editor.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    1,376
    Vote Rating
    117
      0  

    Default

    Let have a try
    Code:
    var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
    	clicksToMoveEditor: 1,
    	autoCancel: false,
    	hideButtons: function(){
    		var me = this;
    		if (me.editor && me.editor.floatingButtons){
    			me.editor.floatingButtons.hide();
    		} else {
    			Ext.defer(me.hideButtons, 10, me);
    		}
    	},
    	listeners: {
    		beforeedit: function(){
    			this.hideButtons();
    		}
    	}
    });

  4. #4
    Sencha Premium Member
    Join Date
    Jul 2011
    Posts
    119
    Vote Rating
    5
      0  

    Default

    Thanks, I got round to trying this and it *almost* works perfectly!

    Unfortunately when you're on the last record (scrolled down to the bottom of the grid) and you scroll sideways while in edit mode, everything goes crazy and the row editor disappears.

    I can't believe this isn't a more common request - the Update / Cancel buttons look so clunky!

  5. #5
    Sencha User
    Join Date
    Jan 2012
    Posts
    1,376
    Vote Rating
    117
      0  

    Default

    Then let try this solution.
    Code:
    var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
        clicksToMoveEditor: 1,
        autoCancel: false,
        hideButtons: function(){
            var me = this;
            if (me.editor && me.editor.floatingButtons){
                me.editor.floatingButtons.getEl().setStyle('visibility', 'hidden');
            } else {
                Ext.defer(me.hideButtons, 10, me);
            }
        },
        listeners: {
            beforeedit: {
                fn: function(){
                    this.hideButtons();
                },
                single: true
            }
        }
    });

  6. #6
    Sencha Premium Member
    Join Date
    Jul 2011
    Posts
    119
    Vote Rating
    5
      0  

    Default

    Actually I think your original solution was fine. I'm having problems even with vanilla rowediting. Seems to be caused by interacting with my combos in the grid. hmm will investigate further.

    Thanks for a great and simple solution!

  7. #7
    Sencha User
    Join Date
    Mar 2013
    Posts
    1
    Vote Rating
    0
      0  

    Default

    This solution is working to hide button.

    But how to fire the update (completeEdit) event when move out the row.??

    Please help.

Tags for this Thread

Posting Permissions

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