Latest web development tutorials
×

jQuery EasyUI Tutorial

jQuery EasyUI Tutorial jQuery EasyUI Introduction

jEasyUI application

jEasyUI Create a CRUD application jEasyUI Create a CRUD data grid jEasyUI Form CRUD application jEasyUI Create an RSS reader

jEasyUI Drag and drop

jEasyUI Basic drag and drop jEasyUI Create a drag-and-drop shopping cart jEasyUI Create a school curriculum

jEasyUI Menus and buttons

jEasyUI Create a simple menu jEasyUI Create a link button jEasyUI Create a menu button jEasyUI Create a split button

jEasyUI layout

jEasyUI Create a border layout jEasyUI Create a complex layout jEasyUI Creates a fold panel jEasyUI Create a tab page jEasyUI Dynamically add a tab jEasyUI Add the AutoPlay tab jEasyUI Create the XP style left panel

jEasyUI Data grid

jEasyUI Convert HTML tables to data grids jEasyUI Get the selected row data jEasyUI Add the query function jEasyUI Add a toolbar jEasyUI Create complex toolbars jEasyUI Sets the frozen column jEasyUI Dynamically change columns jEasyUI Format the column jEasyUI Set sort jEasyUI Custom sorting jEasyUI Create a column combination jEasyUI Add a check box jEasyUI Custom tab jEasyUI Enable in-line editing jEasyUI Extension editor jEasyUI Column operation jEasyUI Merge Cells jEasyUI Create a custom view jEasyUI Create a footer summary jEasyUI Condition Sets the line background color jEasyUI Create an attribute grid jEasyUI The extended line shows the details jEasyUI Create a subgrid jEasyUI Display massive data jEasyUI Add a paging component

jEasyUI window

jEasyUI Create a simple window jEasyUI Customize the Window Toolbar jEasyUI Window and layout jEasyUI Create a dialog box jEasyUI Customize the dialog box

jEasyUI Tree menu

jEasyUI Use the markup to create a tree menu jEasyUI Create an asynchronous tree menu jEasyUI Tree menu to add nodes jEasyUI Create a tree menu with check boxes jEasyUI Tree menu drag and drop control jEasyUI The Tree menu loads the parent / child nodes jEasyUI Create the base tree grid jEasyUI Create a complex tree grid jEasyUI Dynamic loading of tree jEasyUI The tree grid adds pagination jEasyUI Tree-lazy lazy-loading node

jEasyUI Form

jEasyUI Create an asynchronous submission form jEasyUI Form validation jEasyUI Create a tree drop-down box jEasyUI Format the drop-down box jEasyUI Filter down the data grid

jEasyUI Reference Manual

jQuery EasyUI Plugin jQuery EasyUI Extended

jQuery EasyUI based plug - Searchbox search box

jQuery EasyUI plugin jQuery EasyUI plugin

By $ .fn.searchbox.defaults override the default defaults.

Search box (searchbox) prompts the user to enter a search value. It can be combined with a menu that allows the user to select different search categories. When you click the Search button to the right of the component when the user presses the ENTER key or the search operation will be executed.

rely

  • menubutton

usage

Create a search box (Searchbox)

1, created from tags. The 'easyui-searchbox' class added to the <input> tag.

<Script type = "text / javascript">
    function qq (value, name) {
    alert (value + ":" + name)
    }
</ Script>
<Input id = "ss" class = "easyui-searchbox" style = "width: 300px"
    data-options = "searcher: qq, prompt: 'Please Input Value', menu: '# mm'"> </ input>
<Div id = "mm" style = "width: 120px">
    <Div data-options = "name: 'all', iconCls: 'icon-ok'"> All News </ div>
    <Div data-options = "name: 'sports'"> Sports News </ div>
</ Div>

2, the programming created.

<Input id = "ss"> </ input>
<Div id = "mm" style = "width: 120px">
    <Div data-options = "name: 'all', iconCls: 'icon-ok'"> All News </ div>
    <Div data-options = "name: 'sports'"> Sports News </ div>
</ Div>
$ ( '# Ss'). Searchbox ({
    searcher: function (value, name) {
    alert (value + "," + name)
    },
    menu: '# mm',
    prompt: 'Please Input Value'
});

Attributes

名称 类型 描述 默认值
width number 组件的宽度。 auto
height number 组件的高度。该属性自版本 1.3.2 起可用。 22
prompt string 显示在输入框里的提示信息。 ''
value string 输入的值。 ''
menu selector 搜索类型的菜单。每个菜单项可以有下列的属性:
name:搜索类型名称。
selected:当前选择的搜索类型名称。

下面的实例演示了如何定义一个选中的搜索类型名称。
<input class="easyui-searchbox" style="width:300px" data-options="menu:'#mm'" />
<div id="mm" style="width:150px">
	<div data-options="name:'item1'">Search Item1</div>
	<div data-options="name:'item2',selected:true">Search Item2</div>
	<div data-options="name:'item3'">Search Item3</div>
</div>
null
searcher function(value,name) 当用户按下搜索按钮或者按下 ENTER 键时,searcher 函数将被调用。 null

method

名称 参数 描述
options none 返回选项(options)对象。
menu none 返回搜索类型的菜单对象。
下面的实例演示如何改变菜单项图标。
var m = $('#ss').searchbox('menu');  // get the menu object
var item = m.menu('findItem', 'Sports News');  // find the menu item
// change the menu item icon
m.menu('setIcon', {
	target: item.target,
	iconCls: 'icon-save'
});
// select the searching type name
$('#ss').searchbox('selectName', 'sports');
textbox none 返回文本框对象。
getValue none 返回当前的搜索值。
setValue value 设置新的搜索值。
getName none 返回当前的搜索类型名称。
selectName name 选择当前的搜索类型名称。
代码实例:
$('#ss').searchbox('selectName', 'sports');
destroy none 销毁该组件。
resize width 重设组件的宽度。

jQuery EasyUI plugin jQuery EasyUI plugin