ASP. Aries 3.0 release (with General API design and basic Tutorial introduction)

Source: Internet
Author: User

Major updates:

1: Upgrade processing mechanism (JS request changed from synchronous to asynchronous)

2: Optimize the front-end JS: including the API and Configuration methods.

3: Add Inputdialog function.

4: Remote Authentication function is further increased.

5: Optimize the privilege security mechanism.

6: Add the ability to request more than one method at a time.

7: Optimized support text database (save my server Resources for demo demo)

Considerations for upgrading from older versions:

Config_grid field changes for table:

The ViewName field, changed to rules, has a length of 250.

Mergeindexed, renamed as: Mergeindex.

Open Source Address:

Github:https://github.com/cyq1162/aries

Demo Demo: http://aries.cyqdata.com/login.html (has put the demo back to its own VPS, while using the text database)

JS API General Design Thinking Introduction: 1: Namespaces:

Ar. DataGrid: Manipulate tables and tree tables (need to be instantiated).

Ar. Upload: Operation file Upload (need to instantiate, such as: Import button (when clicked, the upload Excel file function)).

Ar. Form: Manipulate a form page (such as a normal edit or new page).

Ar.combobox: Action drop-down box object.

Ar. Utility: Generic tool class: such as the AR.Utility.Ajax class is here.

Ar. Globals: Global objects.

2: Common Events and properties:

1: Objects (including buttons) have $target to obtain the JQ object.

2: Objects (including buttons) have Ishidden properties that can be displayed or hidden by buttons.

3: The object (including the button) has three events (whether the button or the initialization of the object):

Onbeforeexecute

OnExecute (This is done by default)

Onafterexecute

When processing, the corresponding object is found according to the business, and the event can be handled.

4: Some objects have the Items property (Dg.Search.Items, DG. Pkcolumn.items, AR. Global.DG.Items)

5: Some objects have the Add method.

Ar. DataGrid Brief Description: 1: Support Type (normal table (DataGrid) and Tree Table (Treegrid)): 2: Sample code:

var dg=new AR. DataGrid (Objname,tablename,id,type);

Parameters can be controlled here.

Dg.bind ();//Binding table

3: Rendered effect:

Or: (The tree menu is controlled by the right-click menu by default)

4: Table Common internal objects:

1:DG. Toolarea: Includes search and toolbars (ToolBar).

2:DG. Search: Searching for areas

3:DG. ToolBar: Button Tool bar

4:DG. Pkcolumn: Primary key column Area

5:DG. Headermenu: Column Header Right-click menu

6:DG. ContextMenu: Right-click menu for row data

5: Front-end JS API Programming example (combined with common object common events, it is easy to know where to handle the events you want to extend):

For example, if you want to append conditions to a click Query, then the code is:

Dg. Search.btnquery.onbeforeexecute=function (para) {conditions are appended here. }

For example: you want to hide the reset button, then the code is:

Dg. Search.btnreset.ishidden=false;

For example, if you want to assign a value to a box in the query condition, the code is:

Dg. Search.onafterexecute=function (para) {dg. search.items["Column name"].val (123);};

It can also be processed after the page is loaded:

dg.options={

Onloadsuccess:function () {DG. search.items["Column name"].val (123);}

}

Other details, in the source demo is introduced, here is donuts.

Form: Input-related configuration description: 1: Remote validation data exists:
<input name= "UserName"  class= ' Easyui-validatebox ' data-options= "Validtype: ' exists[username] '"  />

Effect: (Implicit conditional parameters within the framework include: Id,ar for page passing.) Form.tablename)

2:inputdialog
<input name= "F4" dialog= "Demo_testa" multiple= "true" editable= "true"/>

Single effect: (First run, you need to configure the following table header, hide the columns that do not need to be rendered, and then set a search box out)

Multi-Select effect:

After selection, it is a drop-down and can be manipulated again:

3: The specific configuration of the dropdown box, in the demo is detailed, so unknown, only a picture:

Configure the configuration rules for the header (that is, the rules field that is changed by ViewName)

Effect:

This configuration is used to control the search area and currently supports the $ and $ configurations, as follows:

$1:{} handles non-drop-down:

If it is a date or data, the default becomes an interval query (such as the F4 field configuration in), which is the default clone:true, sample configuration:

$1:{title: "My title", Width:200,clone:false}

$2:{} processing drop-down:

can set the button width, whether multi-select, whether to choose, whether to render please select, whether to raise the query when selected, sample configuration:

$2:{width:200,height:30,isquery:false,mutiple:true,defaultitem:false}

Ar. Utility.ajax: Request more than one method at a time to return a result collection:

Example code in the framework:

$Core. Utility.Ajax.post ("Getinitconfig,getkeyvalueconfig", NULL, NULL, NULL, NULL, function (Result) {        $ Core.Global.Variable = result. Getinitconfig;        $Core. Global.Variable.isLoadCompleted = true;        $Core. Global.config = result. Getkeyvalueconfig;    });

The result set is returned by combining the methods into JSON.

Other: Reference frame demo, or/web/sysadmin/system function usage:

Summarize:

1: This release personally fencing the front end API (the front end of the previous version was written to another colleague).

Due to the fencing front end, the recent daily toss to 3-4 o ' Night:

2: Improved performance (previous synchronization caused the interface 1-2 seconds blank card, speed experience feeling bad).

3: Improved security (previous version has a certain privilege security issue).

4: Enhance the front-end usage experience.

ASP. Aries 3.0 release (with General API design and basic Tutorial introduction)

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.