EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
May 21, 2024, 08:47:25 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
keypress for multiple text editors
Pages: [
1
]
« previous
next »
Print
Author
Topic: keypress for multiple text editors (Read 972 times)
fonzie
Newbie
Posts: 9
keypress for multiple text editors
«
on:
February 03, 2024, 01:12:47 AM »
I have text editors on different tabs and detect a keypress for autosave like this (simplified for easy reading)
$(function(){
$('#texteditor1').on('keyup',function(e){
console.log(e.keyCode)
})
})
Rather than have five functions to check each editor, I would like to have one function to check a keypress and take action depending on what tab was selected, is this possible ?
Logged
fonzie
Newbie
Posts: 9
Re: keypress for multiple text editors
«
Reply #1 on:
February 03, 2024, 04:50:54 AM »
OK, I solved this myself, code below for anyone that runs into a similar issue (probably for most controls).
$(function(){
$('.easyui-texteditor').on('keyup',function(e){
var idname = $(this).attr('id');
console.log(idname);
console.log(e.keyCode)
});
})
Hope this helps someone
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...