ASP. Aries JSAPI Document Description: Ar.datagrid

Source: Internet
Author: User
Tags index sort

Ar. DataGrid Documentation

Usage:
<body> <table id="DG"></table></body>"Text/javascript">varDG =NewAr. DataGrid ("Sys_role"); Dg.iseditor=true; Dg. Pkcolumn.add ("Detail","Permission Assignment",'roleaction',NULL,"Permission Assignment","Edit");    Dg.bind (); function Roleaction (V, R, i) {varRname =R.rolename; Ar. Utility.Window.open ('roleaction.html?id='+ V,'Current Role ('+ Rname +')'); }</script>

constructor function

Name

Description

New AR. Datagrid

(Objname,tablename,tableid,istreegrid)

ObjName: Main object Name (view name or table name)

Used to get column headers and data rendering tables

TableName: Table name, for edit or delete operations

TableID: Default DG, otherwise you need to specify

Istreegrid: If True.

You also need to specify three parameters:

Dg.options = {

IDfield: "id column",

Treefield: "Name column",

ParentField: "Parent ID column"

}

1: Object:

Name

Description

Pkcolumn

Primary key operation area (edit, delete, save, cancel)

Search

Search Sany

ToolBar

Function Button Area

Headermenu

Configure the right-click menu for a table header

ContextMenu

Right-click menu for Rows

2: Properties:

Name

Description

Internal

Internal parameters, including:

This. Internal = {

PrimaryKey: Primary Key Name,

Headerdata: column header data,

Isloadcompleted: Whether the tabular data has been loaded complete

}

Toolarea

Tool area (includes search area and button area)

This. Toolarea = {

The ID of the Id:div,

$target: JQ object,

Search:this. Search,

Toolbar:this. ToolBar,

Ishidden: Whether hidden (including search hidden and toolbar hidden)

}

Id

The ID of the table

Istreegrid

"False By default" Treegrid or DataGrid property

TableName

Table name

ObjName

Main object Name (view name or table name)

Isshowcheckbox

"Default true" to show check boxes

Isshowtoolarea

"Default true" to show the tool area (equivalent to the Toolarea.ishidden property)

Iseditor

"False By default" enables inline editing

Options

The options parameter of the Easyui (through this parameter, the parameters of the cover Easyui

$target

JQ Object

Defaultinsertdata

When you edit in-line, add the default fill data for the data:

Example:

Dg.defaultinsertdata = {

Objname:objname, align: ' center ', width:100, ordernum:100, Rowspan:1, Colspan:1, mergeindex:1, datatype: ' string,50, 0,0 '

};

3: Method:

Name

Parameters

Description

Addwhere

(Name,

Value

Pattern

Isor)

To add a default query condition:

Example:

Dg.addwhere ("F1", "3", "like");

Name: Field name

Value: Values

Pattern: operator

Like, =, >, <, >=, <=, in, <>, isnull

, Likeor (This is a custom condition)

Isor:and, or

Likeor Example:

Dg.addwhere ("Casual", "id>10 or id<10", "Likeor");

Removewhere

(name)

Remove Addwhere added criteria based on field name

Datagrid

(Key, value)

Unified Treegrid and Easyui usage of the DataGrid

Example:

Dg.datagrid ("getchecked");

GetChecked

()

"Array" to get tick-checked rows

Getcheckedid

(key)

"Array" gets the checked row ID.

Key: If the column name is specified, the specified column is taken.

GetSelected

()

Returns the first selected row record or null

GetData

()

Return loaded data

Reload

()

Overloaded records are the same as the ' load ' method but are overloaded with the current page's record rather than the first page.

Bind

()

Bind a table (previously set parameters, this function starts to combine parameters and get headers and data requests)

Ar. Object description of the DataGrid: The Commonality of objects:

Name

Description

Ishidden

Whether to hide

$target

JQ Object

Onbeforeexecute

OnExecute

Onafterexecute

Before execution (parameters may vary)

Execution (parameters may vary)

After execution (parameters may vary)

1:pkcolumn Property
name

Items

aries.dictionary

Archive primary key column information for each row, only after data is rendered, such as Onloadsuccess event

Editor

{

Btnedit,

Btndel,

Btnsave,

btncancel

}

There are four controllable buttons inside the system.

Other customizations added through the Add method can only be obtained through items.

Button commonality:

Ishidden: Whether to hide

$target: JQ object.

Related events:

Btnedit:onbeforeexecute = function (value, index)

Btndel:onbeforeexecute = function (value, Index)

Btnsave:onbeforeexecute = function (value, index, postdata)

Btncancel:onbeforeexecute = function ( Value, index)

Method

Name

Parameters

Description

Add

Key, title, Clickname, URL, Wintitle, lv2action

/**

* Invalid if setting Clickname Url&wintitle

* @param {string} key points to the key value in the Buttons_temp object of the $core.common.js file

* @param {string} title mouse across the text displayed

* @param {string} clickname event name

* URL to open page @param {string} URL

* @param {string} wintitle the title of the open window

* @param {string} lv2action two-level permission name

*/

2:search Object Properties:

Name

Parameter type

Description

Items

Aries.dictionary

Archives an array of objects of all input, which is not available until the bind () method is called.

Btnquery

Onbeforeexecute (Searchjsonarray):

The Searchjsonarray can be modified

Btnreset

After emptying the value, call the Btnquery to query.

3:toolbar Object Properties:

Name

Parameter type

Description

Items

Aries.dictionary

An array of objects that archive all the buttons before the bind () method is called to get

Btnadd

function (index, issamelevel)

Issavelevel:treegrid when adding a subordinate or sibling

Btndelbatch

Onbeforeexecute = function (IDs, index)

Btnimport

Onbeforeexecute = function (param)

Execute events before importing, set parameters such as: Param.p1 = ABC;PARAM.P2 = 123

Btnexport

Onbeforeexecute = function (param)

* @param {object} param need to change or pass additional parameters to modify Param

Btnexporttemplate

Onbeforeexecute = function (param)

@param {object} param need to change or pass additional parameters to modify Param

Method:

Name

Parameter type

Description

Add

Text, fname, index, CSS, lv2action

/**

* Add a button to the toolbar

* @param the text displayed by the {string} text button

* @param {string} fname button registered event function name

* @param the index sort value of the {int} index button starts at 1 and the default value is finally

* @param {string} CSS style name, default value ' Btn-sm '

* @param {string} lv2action two-level permission control, default value 0

*/

Addhtml

Htmlstring, Index, lv2action

/**

* Add custom HTML elements to the toolbar

* @param {string} htmlstring a string label

* @param the index sort value of the {string} Index button starts at 1 and the default value is finally

* @param {int} lv2action level two permission control, default value 0

*/

4:headermenu, ContextMenu Object properties:

Name

Parameter type

Description

Items

Array

Archive the contents of the right-click menu

[{"Text": "Name", "onclick": "JS event", "Lv2action": "Permissions"},

{"text": "Name 2", "onclick": "JS Event 2", "lv2action": "Rights 2"}

]

Method

name

parameter type

Add

Text, fname, lv2action

 /**

                 * Add a button to the toolbar

                 * @param {string} Text button to display the

                 * @param {string} fname button registered event function name

                *@ Param{string} lv2action Level two permission control, default value 0

  */

ASP. Aries JSAPI Document Description: Ar.datagrid

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.