Data access and update problem in ExtJS store

Source: Internet
Author: User

You can add one or more record to the end of the store using Add (ext.data.record[] records) or add (Ext.data.Record record). Such as:
Copy code code as follows:
var newrecord=new personrecord ({name: "Tom", age:22});
Store.add (NewRecord);

The Add function adds new data to the end of the store, which can cause damage to its original sort, and if you want to keep it in order, you should use addsorted to invoke the same method as Add.
You can use the Insert method to insert a record into a specified location, such as:
Copy code code as follows:
var newrecord=new personrecord ({name: "Tom", age:22});
Store.insert (Store.getcount (), NewRecord);

Delete operations can use the Remove and RemoveAll functions, such as:
Copy code code as follows:
Store.remove (Store.getat (0));
Store.removeall ();

To modify the data in the store:
Copy code code as follows:
Store.getat (0). Set ("Name", "Jesse");

After you modify the internal data in the record, you can either undo all the changes by executing rejectchanges () or submit the data modification by commitchanges.

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.