Insert data with multiselect in Ext. net

Source: Internet
Author: User

The ListBox-like multiselect control is sometimes used in Ext. NET development. Sometimes you need to add a write data to multiselect. How can this problem be solved?

First, let's take a look at how multiselect works. It will automatically load a store when it is created. The record of this store contains two fields: Text and value.

Therefore, we can add the items of multiselect as follows:

View code

 1   Function  Getformulaitems (){  2       VaR Data = New  Array ();  3       //  4  Constructing an initial data array data is omitted  5       //  6   Multiselect. Store. removeall ();  7       For ( VaR I = 0; I <data. length; I ++ ){  8           VaR Record = New  Object ();  9 Record. value = Data [I]; 10 Record. Text = Data [I];  11 Record = New  Ext. Data. Record (record );  12   Multiselect. Store. Add (record );  13   }  14 }

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: 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.