Convert configuration item of Field

Source: Internet
Author: User

The field convert configuration item allows you to define how to display data in the field. Example:

{Name: 'name'}, {Name: 'First name' convert: function (value, record) {var firstname = record. get ('name '). firstname; return firstname ;}}
 
Here, record refers to a piece of data returned. The sample data is in JSON format as an example: {'name': {'firstname': 'jason ', 'lastname': 'ton '}}
 
In general, we use mapping to handle this problem, but when the name is empty, mapping will report an error (this is found in 4.0.2a). Therefore, this method is the safest, you can judge before referencing.

Note: record. the parameter of the get ('name') method must be the name defined in the field. Even if the data you return contains the name attribute, you did not specify it in the field, it is still not recognized.

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.