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 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,556
    Answers
    3932
    Vote Rating
    1272
      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! Checkout the CODE tag!

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

  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
    139
    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
  •