1. #1
    Sencha User
    Join Date
    Aug 2010
    Posts
    177
    Vote Rating
    0
    mcadirci is on a distinguished road

      0  

    Default Non-closing toolbar for multiselect

    Non-closing toolbar for multiselect


    Hello,

    I have a toolbar which has a button with some checkable submenu items. It works great but clicking a submenu item makes the menu closed. I want to click some of the with out reopening the menu.

    Any suggestions would be great.

    Here is my code:
    Code:
    var contentToolbar = new Ext.Toolbar({
        	enableOverflow: true,
        	hideBorders: true,
        	buttonAlign: 'right',
    	    items: [
                {
                	xtype: 'button',
                	text: 'refresh'
                },
    			{
    				xtype: 'button',
    				text: '<fmt:message key="Show"/>',
    				icon:'<c:out value="${pageContext.request.contextPath}"/>/icons/magnifier.png',
                    menu: [
       					{
       						text: '<fmt:message key="AltTextStoppedVehicles"/>',
    		                checked: false,
       		                checkHandler: onItemCheck
    					},
    					{
    						text: '<fmt:message key="AltTextMovingVehicles"/>',
    						checked: false,
    						checkHandler: onItemCheck
    					},{
    						text: '<fmt:message key="AltTextIdleVehicles"/>',
    						checked: false,
    						checkHandler: onItemCheck
    					},
    					{
    						text: '<fmt:message key="AltTextViolationVehicles"/>',
    						checked: false,
    						checkHandler: onItemCheck
    					},
    					{
    						text: '<fmt:message key="AltTextVehiclesInRegion"/>',
    						checked: false,
    						checkHandler: onItemCheck
    					},
    					{
    						text: '<fmt:message key="AltTextVehiclesOutOfRegion"/>',
    						checked: false,
    						checkHandler: onItemCheck
    					},
    					{
    						text: '<fmt:message key="AltTextVehiclesWithNoData"/>',
    						checked: false,
    						checkHandler: onItemCheck
    					}
    				]   
    			}
    		]
        });
    Thanks.

    --
    Mehmet

  2. #2
    Sencha User laurentParis's Avatar
    Join Date
    Aug 2010
    Location
    paris
    Posts
    246
    Vote Rating
    2
    laurentParis is on a distinguished road

      0  

    Default


    can you send us :
    method onItemCheck

    thanks

  3. #3
    Sencha User
    Join Date
    Aug 2010
    Posts
    177
    Vote Rating
    0
    mcadirci is on a distinguished road

      0  

    Default


    At this function I simply filter all my grids.

    Code:
    function onItemCheck(item, checked){
    	if( item.text == '<fmt:message key="AltTextStoppedVehicles"/>' ){
    		stopFilter = checked;
    	}else if( item.text == '<fmt:message key="AltTextMovingVehicles"/>' ){
    		moveFilter = checked;
    	}else if( item.text == '<fmt:message key="AltTextIdleVehicles"/>' ){
    		idleFilter = checked;
    	}else if( item.text == '<fmt:message key="AltTextViolationVehicles"/>' ){
    		violationFilter = checked;
    	}else if( item.text == '<fmt:message key="AltTextVehiclesInRegion"/>' ){
    		inRegionFilter = checked;
    	}else if( item.text == '<fmt:message key="AltTextVehiclesOutOfRegion"/>' ){
    		outOfRegionFilter = checked;
    	}else if( item.text == '<fmt:message key="AltTextVehiclesWithNoData"/>' ){
    		noDataFilter = checked;
    	}
    	var i;
    	
    	for( i = 0 ; i < grids<%=currentTime%>.length ; i ++ ){
    		grids<%=currentTime%>[i].store.filterBy(function (record, id) {
    			if( stopFilter == false && moveFilter == false && idleFilter == false && violationFilter == false && inRegionFilter == false && outOfRegionFilter == false && noDataFilter == false ){
    				return true;
    			}
    			if( (stopFilter == true && record.data.stopFilter == true)
    					|| (moveFilter == true && record.data.moveFilter == true)
    					|| (idleFilter == true && record.data.idleFilter == true)
    					|| (violationFilter == true && record.data.violationFilter == true)
    					|| (noDataFilter == true && record.data.noDataFilter == true)){
    				return true;
    			}				
    			return false;
    		});
    	}
    }

  4. #4
    Sencha User laurentParis's Avatar
    Join Date
    Aug 2010
    Location
    paris
    Posts
    246
    Vote Rating
    2
    laurentParis is on a distinguished road

      0  

    Default


    I suggest to use click event insteat onItemCheck
    with click event you can manage event, because event object is second argument
    so, you can stop event
    PHP Code:
    listeners: {
      
    click: function (iteme) {
        
    e.stopEvent();
       if( 
    item.text == '<fmt:message key="AltTextStoppedVehicles"/>' ){...
      }

    manage check status with item object

  5. #5
    Sencha User
    Join Date
    Aug 2010
    Posts
    177
    Vote Rating
    0
    mcadirci is on a distinguished road

      0  

    Default


    Hello again,

    Thanks for your answer but I can't figure out how can I prevent the toolbar menu from closing.

    I have added the listener to the button:
    PHP Code:
    menu: [
            {
                
    text'<fmt:message key="AltTextStoppedVehicles"/>',
                
    checkedfalse,
                
    listeners: {
                    
    click: function (iteme) {
                        
    e.stopEvent();
                        if( 
    item.text == '<fmt:message key="AltTextStoppedVehicles"/>' ){
                            
    //alert('hello');
                        
    }
                    }
                }
                
    //checkHandler: onItemCheck
            
    }, 
    But still the menu is closed.

Similar Threads

  1. Problems with closing tab which contains grid with toolbar panel
    By diclofoss in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 30 Mar 2009, 9:13 AM
  2. Closing form
    By ExtCrazy in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 12 May 2008, 1:25 AM
  3. Closing a browser window from a toolbar
    By captainm1uk in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 17 Jan 2008, 8:09 AM
  4. Closing tabs
    By ablock in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 20 Nov 2007, 7:36 PM
  5. Toolbar divs need a closing tag sometimes
    By mschering in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 16 May 2007, 5:34 AM

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."