[OPEN] [#125] Disable sort when click GridPanel's Header

  1. #1

    [OPEN] [#125] Disable sort when click GridPanel's Header

    I would like to know whether it's possible to disable sort when click GridPanel's Header. I found the following 1.x examples, but i was not able to accomplish it on version 2.x

    http://forums.ext.net/showthread.php...n-in-gridpanel

    http://forums.ext.net/showthread.php...n-in-GridPanel

    returning false on ColumnModel' HeaderClick handler has no effect.

    Any ideas to overcome this issue?
    Last edited by Daniil; Jan 15, 2013 at 3:14 PM. Reason: [OPEN] [#125]
  2. #2
    Hello!

    Unfortunately, there is no default way to disable sorting on header click. However, you can use following overriding and custom config:

    Ext.override(Ext.grid.column.Column, {
    	onElClick: function (e, t) {
    		var me = this,
    	ownerHeaderCt = me.getOwnerHeaderCt();
    		if (ownerHeaderCt && !ownerHeaderCt.ddLock) {
    			if (me.triggerEl && (e.target === me.triggerEl.dom || t === me.triggerEl.dom || e.within(me.triggerEl))) {
    				ownerHeaderCt.onHeaderTriggerClick(me, e, t);
    			} else if (e.getKey() || (!me.isOnLeftEdge(e) && !me.isOnRightEdge(e))) {
    				if (!this.disableSortOnHeaderClick)
    					me.toggleSortState();
    				ownerHeaderCt.onHeaderClick(me, e, t);
    			}
    		}
    	}
    
    });
    <ext:Column runat="server" Text="Company" DataIndex="company" Flex="1">
    	<CustomConfig>
    		<ext:ConfigItem Name="disableSortOnHeaderClick" Value="true" Mode="Raw"  />
    	</CustomConfig>
    </ext:Column>
  3. #3
    You can use Sortable=false for a column but it disables column menu sort items also
  4. #4
    Hi everybody,

    I tried to report this functionality regress as a bug.
    http://www.sencha.com/forum/showthread.php?253875

    Hope they will implement a special config option for this.
  5. #5
    Sencha opened a bug ticket.

    We created an Issue to monitor.
    https://github.com/extnet/Ext.NET/issues/125

Similar Threads

  1. Replies: 8
    Last Post: Dec 21, 2012, 6:42 AM
  2. [CLOSED] PropertyGrid disable sort
    By LeeTheGreek in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 07, 2012, 4:50 AM
  3. Replies: 4
    Last Post: Jul 25, 2011, 4:57 PM
  4. Replies: 4
    Last Post: Mar 01, 2011, 9:45 AM
  5. Replies: 2
    Last Post: Nov 15, 2010, 10:12 AM

Posting Permissions