EasyUI Forum
April 20, 2024, 01:20:45 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [SOLVED] DoubleClick event on TextBox  (Read 8507 times)
Pierre
Sr. Member
****
Posts: 439


View Profile Email
« on: January 02, 2017, 01:47:48 AM »

Hello
how to know when user doubleclicked on textbox?
As I can see there is no such event.
Thank you for help.
« Last Edit: January 06, 2017, 12:40:34 AM by Pierre » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: January 02, 2017, 11:49:14 PM »

You can extend the $.fn.textbox.defaults.inputEvents to attach a dblclick event.
Code:
$.extend($.fn.textbox.defaults.inputEvents, {
dblclick: function(e){
//...
}
})
Logged
Pierre
Sr. Member
****
Posts: 439


View Profile Email
« Reply #2 on: January 03, 2017, 12:36:20 AM »

Hello
thank you. I appreciate your help.
Logged
Pierre
Sr. Member
****
Posts: 439


View Profile Email
« Reply #3 on: January 03, 2017, 05:45:31 AM »

Hello
thank you. I appreciate your help.

Hello
I still don't know how to implement this on simple textbox.. Sad
If I have textbox with id="my", how would be the sample code to check does user doubleclicked on my textbox?
Thank you.
Logged
Pierre
Sr. Member
****
Posts: 439


View Profile Email
« Reply #4 on: January 03, 2017, 06:03:43 AM »

Hello
if I use this:
Code:
$.extend($.fn.numberbox.defaults.inputEvents, {
dblclick: function(e){
alert($(this).attr('id')); 
}
})
then I see something like: _easyui_textbox_input37
Question is - how to get input ID (I have declared id and name).
Thank you.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #5 on: January 03, 2017, 08:22:10 AM »

Please try this code.
Code:
$.extend($.fn.numberbox.defaults.inputEvents, {
dblclick: function(e){
var t = $(e.data.target);
var id = t.attr('id');
var text = t.textbox('getText');
}
})
Logged
Pierre
Sr. Member
****
Posts: 439


View Profile Email
« Reply #6 on: January 03, 2017, 10:26:05 AM »

Thank you, it is not what I needed but I found a solution (I need to know on what field user doubleclicked, not what value have the field).
Here is how I use it now:
Code:
$.extend($.fn.numberbox.defaults.inputEvents, {
dblclick: function(e){
var t = $(e.data.target);
var id = t.attr('id');
alert(id); <- Here I see my field "id", like "first_name", "last_name" etc.
}
});

Thank you!  Grin
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!