ASP. NET Aries Tutorial 6: Formatting and inline editing of list data tables

Source: Internet
Author: User

Objective:

In order to catch the progress, the weekend also wrote the text!

The previous few talk about the query box and toolbar, this section of the table data related operations.

Look at the list first:

We have a lot of things to do next.

1: Formatting-translation of key values

For the enable column , you have already configured the formatting #是否 to see the effect.

For the category ID column, the category name is usually displayed instead of the ID value.

But the classification name is not in the article table, in the article classification tables, how to associate formatting it?

We have the article classification table:

So let's write a drop-down configuration:

Then configure it in the Configuration table header:

Effect:

PS: Use custom statements to translate the notes for the drop-down:
1: The number of translated items is below 100, at least at a predictable order of magnitude. 2: If the order of magnitude cannot be predicted, then the custom view statement should be used , when the data is rendered directly the name.
1.1 Custom View Statements:

New V_xxx.sql file in the Sqlcode directory, the file can be placed at will, but the filename cannot appear duplicated.

SQL is associated with a good table in advance, the name of the article category is evaluated.

Next: The code in the HTML:

var dg = new AR. DataGrid ("v_articlelist", "article", "grid");

Write the objname parameter as the name of the file.

2: Format-Custom JS function

For formatting, you can also customize JS in addition to configuring #xxx to format key-value pairs.

The system defaults to writing 3 functions for formatting:

Stringformatter: When the length is too long, it is displayed as ...

Dateformatter: Displayed as Date

Boolformatter: Show as checkbox

Example:

Defines the Showaries function, which configures the table header joins:

Effect:

3: Formatting-Two formatting of key-value pairs

If the format is used in the #xxx configuration (there is no way to customize the Write JS), and then want to two times format it?

Effect:

4: Style formatting

Define a style function:

Configure the style function to the configuration header:

Effect:

The format of a style is actually a style that handles <TD style= style > Content </td>.

This function may be considered canceled later, because the same effect, the formatted function can also be completed such as:

Formatted return: "<div style=" Width:100%;background-color: #ffee00; color:red; " >value</div> "

5: Remove Width Adaptive

By default, the width of the list is adaptive, which can be adapted to different display requirements for different resolutions.

But there is one case where we want to remove the width adaptive (adaptive no scroll bar): When the column is a lot .

Control the fitcolumns of the Easyui.

6: In-line editing-open:

If it's just a simple table operation, opening inline editing is the easiest thing to do:

Effect:

Because the formatting is configured, it becomes a drop-down effect.

7: Inline edit-Specifies editable columns:

In the configuration header of the edit item, check the box:

8: Inline edit-New specified default value

When you add a button to the default point:

For example, specify default values for categories and headings:

PS: To be compatible with Oracle (the column header of the default list and the field name of the data are unified to lowercase )

Effect:

9: Inline editing-determines the values of other columns by the value of a column:

For example, when the classification of the choice of different, the title of the content is: Category name + title.

Effect:

10: Inline edit-added jump to custom page processing:

This goes back to the previous article: ASP. NET Aries Tutorial 5: Customizing the contents of the " other 1:" item in the toolbar area of the list page.

11: Master-Slave table:

Easyui Support master-slave table, give the idea:

Effect:

Summarize:

This section focuses on two core: formatting, inline editing.

The next section describes the primary key operation area of the list.

ASP Aries Tutorial 6: Formatting and inline editing of list data tables

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.