EasyUI Forum
May 21, 2024, 11:17:58 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: how can Change buttontext of searchbox by javascript?  (Read 3574 times)
MSAG
Newbie
*
Posts: 41



View Profile Email
« on: November 04, 2018, 10:29:49 AM »

Hi
how can Change buttontext of searchbox by javascript?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: November 05, 2018, 02:14:00 AM »

You can call 'selectName' method to change the category name on the button.
Code:
<input id="sb" class="easyui-searchbox" data-options="prompt:'Please Input Value',menu:'#mm',searcher:doSearch" style="width:100%">
<script>
$(function(){
$('#sb').searchbox('selectName','sports')
})
</script>
Logged
MSAG
Newbie
*
Posts: 41



View Profile Email
« Reply #2 on: November 05, 2018, 03:10:40 AM »

thanks for your reply

but i didn't change category text

that is what I mean

<input id="sb" class="easyui-searchbox" data-options="buttonText:'This Text',buttonIcon:'icon-Filter',prompt:'Please Input Value',menu:'#mm',searcher:doSearch" style="width:100%">

buttonText that is from TextBox and SearchBox

can I change it from javascript?

Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: November 05, 2018, 05:10:42 PM »

Please try this code to append a new button to the searchbox component.
Code:
var btn = $('<a href="#" class="textbox-button textbox-button-right"></a>').appendTo($('#sb').next());
btn.linkbutton({
  text:'This Text',
  iconCls:'icon-filter'
});
$('#sb').searchbox('resize')
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!