EasyUI Forum
May 17, 2024, 09:30:41 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Poll
Question: how to call the function by clicking enter in datebox
how to call the function by clicking enter in datebox - 0 (0%)
how to call the function by clicking enter in datebox - 0 (0%)
how to call the function by clicking enter in datebox - 0 (0%)
Total Voters: 0

Pages: [1]
  Print  
Author Topic: enter functionality for easyui-datebox  (Read 8026 times)
srg
Newbie
*
Posts: 5


View Profile Email
« on: May 05, 2014, 03:12:12 AM »

Hi All,

For easyui-datebox, without key handler, is there any other way to call a function by clicking an enter key (like onKeyPress, onKeyUp...). I tried like below..

<div class="formCell">
            input id="timiLimitFrom" name="<%= Constants.FILTER_FIELD_TIME_LIMIT_FROM %>" type="text" class="easyui-datebox"  sharedCalendar="#sc" data-options="formatter:dateFormat,parser:dateParser,validType:'europeanDateValidator'" style="width:100px;" onkeypress="if (event.which == 13) { inboxFilter.apply(); }"/>
</div>

This is my current code.  but it is not calling if i click enter on datebox. Could anyone please help. and currently my date box in jsp page is as shown in attachment...

..
Thanks in advance,
SRG...
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: May 05, 2014, 06:59:29 AM »

If you want to bind the 'keypress' event on the text box, call 'textbox' method to get the text box before binding any events on it.
Code:
$('#dd').datebox('textbox').bind('keypress',function(e){
console.log(e.keyCode)
});
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!