1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    8
    Vote Rating
    0
    mr.atultiwari is on a distinguished road

      0  

    Question Answered: How to add and handle mousedown event on Textfield in ExtJs 4 in MVC

    Answered: How to add and handle mousedown event on Textfield in ExtJs 4 in MVC


    Hi,

    Can any one help me by providing the code to add and handle "Double right click" event on Textfield.
    I 'm using MVC architecture and inside TestController.js file , I had written following code :-

    init: function() {
    this.control({
    'TestView textfield[id = txtField]': {
    mousedown: this.onMouseDownEvent
    },
    onMouseDownEvent: function() {
    some code .....
    }
    });
    }

    can any one help.....

    thanks in advance.

  2. A bit demanding, aren't we?

    Unfortunately, the form field components don't have component-level events for mouse double-click. However, Ext.Element() objects do.

    In order for the Controller to monitor a double-click event (via a ComponentQuery) you're going to have to customize the form field.

    One way to do this might be to extend the form field, and add a new event called something like "doubleclick". Then, you'll have to add some logic that wires the "dblclick" event from the field's Ext.Element() (this.el) to your new "doubleclick" event.

    I'm not writing that code for you. However, if you decide to try my suggestion (and post your code) I'll try to help you along.

  3. #2
    Sencha - Services Team arthurakay's Avatar
    Join Date
    Sep 2008
    Location
    Antioch, IL
    Posts
    1,317
    Answers
    58
    Vote Rating
    23
    arthurakay has a spectacular aura about arthurakay has a spectacular aura about arthurakay has a spectacular aura about

      0  

    Default


    A bit demanding, aren't we?

    Unfortunately, the form field components don't have component-level events for mouse double-click. However, Ext.Element() objects do.

    In order for the Controller to monitor a double-click event (via a ComponentQuery) you're going to have to customize the form field.

    One way to do this might be to extend the form field, and add a new event called something like "doubleclick". Then, you'll have to add some logic that wires the "dblclick" event from the field's Ext.Element() (this.el) to your new "doubleclick" event.

    I'm not writing that code for you. However, if you decide to try my suggestion (and post your code) I'll try to help you along.
    Arthur Kay
    Developer Relations Manager, Sencha Inc.

    Twitter | Sencha Chicago User Group

  4. #3
    Sencha User
    Join Date
    Sep 2011
    Posts
    8
    Vote Rating
    0
    mr.atultiwari is on a distinguished road

      0  

    Default


    Thanks Arthur for your reply,

    I goggled the different ways to find the solution but I was unable to find the solution,
    so at last after debugging the "keydown" event I understood how the events works,
    I was not able to create a event on "Right double click", but was ale to make in Left double click event,
    I'm writing the method I used, hope it is useful for other guys also

    "Double click" event on textfield in Extjs 4 MVC

    1. In "ext-4.0" folder search "Text.js" file
    2. Now inside this search "keydown" event, it will be found at 2 places so you have to write the same code for "doubleclick" event in the same manner as it is written for "kedown" event.
    3. Now in TestController.js file in mine case , call the doubleclick event inside this.control, i.e. :-

    init: function() {
    this.control({
    'TestView textfield[id = txtField]': {
    mousedown: this.onMouseDownEvent,
    doubleclick: this.onDoubleClickEvent
    },
    onMouseDownEvent: function() {
    some code .....
    },
    onDoubleClickEvent: function() {
    some code .....
    }

    });
    }

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar