ASP. NET Aries JSAPI documentation Description: AR. DataGrid, jsapiar. datagrid
AR. DataGrid document
Usage:
<Body> <table id = "dg"> </table> </body>
Constructor
Name |
Description |
New AR. DataGrid (ObjName, tableName, tableID, isTreeGrid) |
ObjName: name of the primary object (view name or table name) Used to obtain the column header and data presentation table TableName: Table Name, used for editing or deleting operations TableID: The default value is dg. Otherwise, you must specify IsTreeGrid: true. You must specify three parameters at the same time: 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 query Area |
ToolBar |
Function button Area |
HeaderMenu |
Configure the right-click menu of the header |
ContextMenu |
Right-click a row |
2: attributes:
Name |
Description |
Internal |
Internal parameters, including: This. Internal = { Primarykey: primary key name, HeaderData: column header data, IsLoadCompleted: whether table data has been loaded } |
ToolArea |
Tool area (including search area and button Area) This. ToolArea = { Id: div ID, $ Target: JQ object, Search: this. Search, ToolBar: this. ToolBar, IsHidden: whether to hide (including Search hiding and ToolBar hiding) } |
Id |
Table ID |
IsTreeGrid |
[False by default] TreeGrid or DataGrid attributes |
TableName |
Table Name |
ObjName |
Primary Object Name (view name or table name) |
IsShowCheckBox |
[True by default] whether to display the check box |
IsShowToolArea |
[True by default] whether to display the tool area (equivalent to the ToolArea. isHidden attribute) |
IsEditor |
[False by default] whether to enable in-row editing |
Options |
Options parameter of Easyui (this parameter overwrites parameters of EasyUI |
$ Target |
JQ object |
DefaultInsertData |
When editing in the row, add the default data filling: Example: Dg. defaultInsertData = { Objname: objName, align: 'center', width: 100, ordernum: 100, rowspan: 1, colspan: 1, mergeIndex: 1, ype: 'string, 50, 0, 0' }; |
3: method:
Name |
Parameters |
Description |
AddWhere |
(Name, Value, Pattern, IsOr) |
Add default query conditions: Example: Dg. addWhere ("f1", "3", "like "); Name: field name Value: value Pattern: Operator Like, =,>, <, >=, <=, in, <>, isnull , Likeor (this is a custom condition) IsOr: and, or Likeor example: Dg. addWhere ("random", "id> 10 or id <10", "likeor "); |
RemoveWhere |
(Name) |
Remove the conditions added by addWhere Based on the field name |
Datagrid |
(Key, value) |
Unify EasyUI usage of treegrid and datagrid Example: Dg. datagrid ("getChecked "); |
GetChecked |
() |
[Array] to obtain the checked row |
GetCheckedId |
(Key) |
[Array] to obtain the ID of the row to be checked. Key: If the column name is specified, the specified column is used. |
GetSelected |
() |
Returns the first selected row record or null. |
GetData |
() |
Returned loaded data |
Reload |
() |
Reload records are the same as the 'load' method, but reload records on the current page instead of the first page. |
Bind |
() |
Bind a table (parameters are set before, and this function starts to combine parameters and get the header and data requests) |
AR. DataGrid object Introduction: common objects:
Name |
Description |
IsHidden |
Hide or not |
$ Target |
JQ object |
OnBeforeExecute OnExecute OnAfterExecute |
Before Execution (parameters may be different) Run (parameters may be different) After execution (parameters may be different) |
1: PKColumn attribute
Name |
Type |
Description |
Items |
Aries. Dictionary |
Archive the information of the primary key columns of each row, which can only be obtained after the data is presented, such as the onLoadSuccess event. |
Editor |
{ BtnEdit, BtnDel, BtnSave, BtnCancel } |
There are four internal controllable buttons. You can only use Items to customize the add method. Button commonalities: 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 |
/** * It is invalid if clickname url & winTitle is set. * @ Param {string} key points to the key value in the $ Core. Common. js file buttons_temp object * @ Param {string} title move the cursor over the displayed text * @ Param {string} clickname event name * @ Param {string} url the URL of the page to be opened * @ Param {string} the title of the window opened by winTitle * @ Param {string} lv2action level-2 permission name */ |
2: Search object attributes:
Name |
Parameter type |
Description |
Items |
Aries. Dictionary |
Archive all Input object arrays, which can be obtained only after the bind () method is called. |
BtnQuery |
|
OnBeforeExecute (searchJsonArray ): SearchJsonArray can be modified. |
BtnReset |
|
After the value is cleared, BtnQuery is called for query. |
3: ToolBar object attributes:
Name |
Parameter type |
Description |
Items |
Aries. Dictionary |
Object array for archiving all buttons, which can be obtained only after the bind () method is called |
BtnAdd |
|
Function (index, isSameLevel) IsSaveLevel |
BtnDelBatch |
|
OnBeforeExecute = function (ids, index) |
BtnImport |
|
OnBeforeExecute = function (param) // Execute the event before import. set parameters such as param. p1 = abc; param. p2 = 123 |
BtnExport |
|
OnBeforeExecute = function (param) * @ Param {object} param needs to be changed or additional parameters can be passed to modify param |
BtnExportTemplate |
|
OnBeforeExecute = function (param) @ Param {object} param: you can modify the param object if you need to change the param object or pass additional parameters. |
Method:
Name |
Parameter type |
Description |
Add |
Text, fname, index, css, lv2action |
/** * Add a button to the toolbar * @ Param {string} text displayed by the text button * @ Param {string} The Name Of The Event function registered by the fname button * @ Param {int} the index sorting value starts from 1. The default value is last. * @ Param {string} css style name. Default Value: 'btn-sm' * @ Param {string} lv2action level-2 permission control. The default value is 0. */ |
AddHtml |
HTMLString, index, lv2action |
/** * Add custom HTML elements to the toolbar * @ Param {string} HTMLString a string tag * @ Param {string} the index sorting value starts from 1 and ends with the default value * @ Param {int} lv2action level-2 permission control. The default value is 0. */ |
4: HeaderMenu and ContextMenu object attributes:
Name |
Parameter type |
Description |
Items |
Array |
Archive context menu content [{"Text": "name", "onclick": "JS event", "lv2action": "permission "}, {"Text": "name 2", "onclick": "JS event 2", "lv2action": "permission 2 "} ] |
Method
Name |
Parameter type |
Description |
Add |
Text, fname, lv2action |
/** * Add a button to the toolbar * @ Param {string} text displayed by the text button * @ Param {string} The Name Of The Event function registered by the fname button * @ Param {string} lv2action level-2 permission control. The default value is 0. */ |