Learn ALTAS Notes [client JS and ALTAS environment initialization relationships and client processing of data returned by datatable]

Source: Internet
Author: User
1. When WebService is called on the client, the script execution sequence is incorrect (error: XXX is not defined !). The problem is that Atlas has not been initialized yet.
Solution ALTAS has a sys. application, which is a global variable. It exists as long as you reference atlas and has a load event. Use SYS. application. Load. Add (mainloop );
2. Data Processing of the datatable returned by the client operation: The following methods are available for datatable objects:

  1. Add: Add the passed datarow object to the current able. The imported datarow object must have the same schema as the datatable object. Recommended firstCreaterowMethod to create a new row and use it as a parameter of this method.
  2. Clear: Clears all rows of the current able.
  3. Remove: Deletes a row of the current able based on the input datarow object.
  4. Createrow: Creates a new row based on the schema of the current able.
  5. Getchanges: Get the modification to the datatable. The return values of this method include the following three sets:
    1. Updated: Set of datarow modified.
    2. Inserted: The set of added datarow.
    3. Deleted: The set of deleted datarow.
  6. Getcolumn: Searches for and returns a datacolumn object in the able based on the input column name.
  7. Getrow: Return the corresponding datarow object based on the input index value.
  8. Getitem: AndGetrowThe method functions are the same. It is estimated that a more generalized name is provided.

Processed script:

// Display the user list
For (VAR I = 0; I <aruserlist. get_length (); I ++)
{
// User Login Name
VaR username = aruserlist. getitem (I). getproperty ('username ');

// Nickname
VaR nickname = aruserlist. getitem (I). getproperty ('nickname ');
}

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.