-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathindex.ts
More file actions
33 lines (24 loc) · 876 Bytes
/
index.ts
File metadata and controls
33 lines (24 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { Mention } from '@syncfusion/ej2-dropdowns';
// define the array of complex data
let countriesData: { [key: string]: Object }[] = [
{ Country : 'Australia', Code : 'AU'},
{ Country : 'Bermuda', Code : 'BM' },
{ Country : 'Canada', Code : 'CA' },
{ Country : 'Cameroon', Code : 'CM' },
{ Country : 'Denmark', Code : 'DK' }
];
// initialize Mention control
let mentionObject: Mention = new Mention({
//set the data to dataSource property
dataSource: countriesData,
// maps the appropriate column to fields property
fields: { text: 'Country', value: 'Code' },
//set height to popup list
popupHeight: '200px',
//set width to popup list
popupWidth: '250px',
//set requireLeadingSpace to popup list
requireLeadingSpace : false
});
// render initialized Mention
mentionObject.appendTo('#mentionElement');