Results 1 to 4 of 4

Thread: Add Record Button in Grid GroupHeaderTpl Alignment

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    21
    Vote Rating
    0
      0  

    Default Unanswered: Add Record Button in Grid GroupHeaderTpl Alignment

    Hello I created a Grid that is always grouped and I needed a button in the group header to add specific types to the grouped section.

    I added an html button to the group header that I used css style float to align it to the right.

    Code:
     
    var groupingFeature = Ext.create('Ext.grid.feature.Grouping',{
            groupHeaderTpl: '{name} <input type="image" style="float:right;" src="ext/examples/shared/icons/fam/add.png" value="add{name}" onClick="addBlock(this);">',
            enableNoGroups: false
        });
    The problem is

    1. In firefox the alignment is not inline with the header text, in IE it is inline.

    2. How can I remove the section expand/collapse event on click from the groupheader as I do not want this to fire when the user clicks on the Add button. The collapse event should only fire when someone clicks on the Header or the +/- symbol.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,421
    Answers
    3901
    Vote Rating
    1271
      0  

    Default

    1. This is going to be your CSS
    2. There is no before event that you can cancel or config to turn that part off. You would have to create an override that I would override the onGroupClick on the Grouping feature and stop it there if it's not on the expand/collapse icon.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    21
    Vote Rating
    0
      0  

    Default

    I guess that should work.

  4. #4
    Ext GWT Premium Member
    Join Date
    Oct 2009
    Posts
    137
    Vote Rating
    5
      0  

    Default

    And where is addBlock(this); method is defined? I am not able to get input onclick to be fired. Console echo works, onclick not.

    thx

    Code:
    features: [ Ext.create('Ext.grid.feature.Grouping',{
    		        	groupHeaderTpl: 
    		        		Ext.create('Ext.XTemplate',
    ' {[this.groupSelect()]}: <input type="button" onclick="this.groupSelect()" value="select"> {name} ',
    		            		    {
    		            		        groupSelect: function(value) { console.log('tpl grp sel: '+value); }
    		            		    }
    		        		),

Posting Permissions

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