EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: srg on May 05, 2014, 03:12:12 AM



Title: enter functionality for easyui-datebox
Post by: srg 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...


Title: Re: enter functionality for easyui-datebox
Post by: stworthy 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)
});