1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    84
    Vote Rating
    0
    prajeesh_bs is on a distinguished road

      0  

    Default panel keyboard event

    panel keyboard event


    I have a panel. I need to delete the panel when delete button is pressed. i have tried the following code.
    Code:
    
    var delete= Ext.KeyMap(Ext.get(document), {
        key:46, //  Ext.EventObject.DELETE
       // ctrl:true,
        fn:function(e){
              //function for deleting the panel
        },
        stopEvent:true
    });
    this works quite well. But the problem is that i cant delete the characters entered in a textfield using delete key because the above function is invoked.

    How can i make both functions work?

  2. #2
    Sencha User
    Join Date
    Apr 2011
    Posts
    84
    Vote Rating
    0
    prajeesh_bs is on a distinguished road

      0  

    Default


    when i dblclick the panel i get the id of that panel and when i press an extjs button i am destroying the panel using the id. wat i need is when i double click the panel and press the delete button of keyboard, the same function needs to be executed. Can anybody help?

  3. #3
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,573
    Vote Rating
    310
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    This example may help. My CSS styling is a bit rubbish but you should get the idea...

    Code:
    .delete-target .x-panel-header-text {
        color: red;
    }
    Code:
    Ext.ns('My');
    
    My.PanelDeleter = {
        deletePanel: function() {
            if (!this.deleteTarget || !this.deleteTarget.ownerCt) {
                return;
            }
    
            var ownerCt = this.deleteTarget.ownerCt;
    
            this.deleteTarget.ownerCt.remove(this.deleteTarget);
            ownerCt.doLayout();
    
            this.deleteTarget = null;
        },
    
        setTarget: function(deleteTarget) {
            if (this.deleteTarget) {
                this.deleteTarget.getEl().removeClass('delete-target');
            }
    
            this.deleteTarget = deleteTarget;
            deleteTarget.getEl().addClass('delete-target');
        }
    };
    
    new Ext.KeyMap(Ext.getBody(), {
        key: Ext.EventObject.DELETE,
        fn: function(key, ev){
            if (Ext.fly(ev.getTarget()).is('input')) {
                return;
            }
    
            My.PanelDeleter.deletePanel();
        }
    });
    
    new Ext.Panel({
        height: 500,
        renderTo: Ext.getBody(),
        width: 300,
        items: [
            {
                cls: 'deletable',
                flex: 1,
                items: {xtype: 'textfield'},
                title: 'Title'
            }, {
                cls: 'deletable',
                flex: 1,
                items: {xtype: 'textfield'},
                title: 'Title'
            }, {
                cls: 'deletable',
                flex: 1,
                items: {xtype: 'textfield'},
                title: 'Title'
            }
        ],
        layout: {
            align: 'stretch',
            defaultMargins: '5',
            padding: 5,
            type: 'vbox'
        },
        listeners: {
            afterrender: function(panel) {
                panel.getEl().on('click', function(ev, delegate) {
                    My.PanelDeleter.setTarget(panel.getComponent(delegate.id));
                }, null, {delegate: '.deletable'});
            }
        }
    });

  4. #4
    Sencha User
    Join Date
    Apr 2011
    Posts
    84
    Vote Rating
    0
    prajeesh_bs is on a distinguished road

      0  

    Default


    excellent Skirtle..
    if (Ext.fly(ev.getTarget()).is('input')) {
    return;
    this was what i needed..once again thanks for ur solution

  5. #5
    Sencha User
    Join Date
    Apr 2011
    Posts
    84
    Vote Rating
    0
    prajeesh_bs is on a distinguished road

      0  

    Default


    i need a suggestion from ur side..

    i have a dataview and i am showing some images inside it. Now i am doing pagination for the dataview. I dont need the default paging bar using extjs. What i need is a customised one. That is there will be an icon for showing previos page on the left side of dataview and an icon indicating next page on the right page. Is it possible to customize the paging bar in this way?

Thread Participants: 1

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..." hd porno faketaxi