jQuery EasyUI plugin

jQuery EasyUI provided for creating cross-browser web pages complete set of components, including powerful datagrid (data grid), treegrid (tree form), panel (Panel), combo (drop-down combination) and so on. Users can combine these components can also be used alone one.

Plug-in list

Base (base)

Layout (Layout)

Menu (Menu) and Button (Button)

Form (Form)

Window (Window)

DataGrid (Data Grid) and Tree (Tree)

Widget

Easyui Each component has properties, methods and events. Users can easily extend to those components.

Attributes

It is defined in the jQuery.fn. {Plugin} .defaults. For example, dialog attributes are defined in jQuery.fn.dialog.defaults.

event

Event (callback function) is defined in jQuery.fn. {Plugin} .defaults.

method

Method call syntax: $ ( 'selector') plugin ( 'method', parameter);.

among them:

  • jquery selector is the object selector.
  • plugin is a plug-in name.
  • method with plug to match the existing method.
  • parameter is a parameter object can be an object, a string /en.

The method is defined in jQuery.fn. {Plugin} .methods. Each method has two parameters: jq and param. The first parameter 'jq' is necessary, a reference to the jQuery object. The second parameter 'param' refers to the actual method parameters passed. For example, to extend dialog component method called 'mymove' approach, as follows:

$ .extend ($. Fn.dialog.methods, {
    mymove: function (jq, newposition) {
		return jq.each (function () {
			$ (This) .dialog ( 'move', newposition);
		});
    }
});

Now you can call 'mymove' method to move the dialog box (dialog) to the specified location:

$ ( '# Dd'). Dialog ( 'mymove', {
    left: 200,
    top: 100
});

I started using jQuery EasyUI

Download Library, and references EasyUI CSS and JavaScript files in your page.

<Link rel = "stylesheet" type = "text / css" href = "easyui / themes / default / easyui.css">
<Link rel = "stylesheet" type = "text / css" href = "easyui / themes / icon.css">
<Script type = "text / javascript" src = "easyui / jquery-1.7.2.min.js"> </ script>
<Script type = "text / javascript" src = "easyui / jquery.easyui.min.js"> </ script>

Once you reference EasyUI necessary files, you can define a EasyUI components through the use of tags or JavaScript. For example, to a top panel with a folding function, you need to write the HTML code as follows:

<Div id = "p" class = "easyui-panel" style = "width: 500px; height: 200px; padding: 10px;"
    title = "My Panel" iconCls = "icon-save" collapsible = "true">
    The panel content
</ Div>

When creating a component by marking, 'data-options' attribute is used to support the property name since Version 1.3 HTML5 compatible. So you can rewrite the above code as follows:

<Div id = "p" class = "easyui-panel" style = "width: 500px; height: 200px; padding: 10px;"
    title = "My Panel" data-options = "iconCls: 'icon-save', collapsible: true">
    The panel content
</ Div>

The following code shows how to create a bound combo box 'onSelect' event.

<Input class = "easyui-combobox" name = "language"
    data-options = "
    url: 'combobox_data.json',
    valueField: 'id',
    textField: 'text',
    panelHeight: 'auto',
    onSelect: function (record) {
    alert (record.text)
    } ">