EasyUI Forum
November 06, 2025, 04:37:16 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: datagrid search with enter key  (Read 12720 times)
jaimi
Full Member
***
Posts: 121


View Profile
« on: November 11, 2014, 11:34:01 PM »

Hello,
after putting a value within the search field of a datagrid, I want to activate the search submit button with the enter-key.

How can I do that?

ths, Jaimi
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: November 11, 2014, 11:51:31 PM »

The 'searchbox' component has built-in searching functionality. The 'searcher' function will be called when the user enters something and press ENTER key.
Code:
<input class="easyui-searchbox" style="width:300px" data-options="
prompt:'Please Input Value',
searcher:function(value){
alert('You input: '+value);
}
">
Logged
jaimi
Full Member
***
Posts: 121


View Profile
« Reply #2 on: November 12, 2014, 11:26:03 PM »

Thanks this works. Is there a possibility to avoid the search-icon within the field?
thx, Jaimi
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: November 13, 2014, 01:34:14 AM »

You can set the 'iconWidth' property to 0 to hide the searching icon.
Code:
<input class="easyui-searchbox" style="width:300px" data-options="
prompt:'Please Input Value',
iconWidth:0,
searcher:function(value){
alert('You input: '+value);
}
">
Logged
jaimi
Full Member
***
Posts: 121


View Profile
« Reply #4 on: November 17, 2014, 01:06:43 AM »

thanks, that works.
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!