File tree 1 file changed +37
-0
lines changed
1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,43 @@ Then you will be able to declare the fields in the html of your component:
55
55
< PickerField hint = " Click here" [items ]= " pickerItems" > </PickerField >
56
56
` ` `
57
57
58
+ ### Custom item template
59
+
60
+ You can also define your own item template in the list that is opened:
61
+
62
+ ` ` ` html
63
+ < PickerField hint = " Click here" class = " picker-field" textField = " name" [pickerTitle ]= " 'Select item from list'" [items ]= " items" >
64
+ < ng - template let - item = " item" >
65
+ < GridLayout columns = " auto, *" rows = " auto, *" >
66
+ < Label text = " Static text:" col = " 0" > </Label >
67
+ < Label [text ]= " item?.name" col = " 0" row = " 1" > </Label >
68
+ < Image [src ]= " item?.imageUrl" col = " 1" row = " 0" rowSpan = " 2" > </Image >
69
+ < / GridLayout >
70
+ < / ng - template >
71
+ < / PickerField >
72
+ ` ` `
73
+
74
+ With the following bindings:
75
+
76
+ ` ` ` ts
77
+ interface IDataItem {
78
+ name: string ;
79
+ id : number ;
80
+ description : string ;
81
+ imageUrl : string ;
82
+ }
83
+
84
+ this .items = new ObservableArray <IDataItem >();
85
+ for (let i = 0 ; i < 20 ; i ++ ) {
86
+ this.items.push({
87
+ name : ' Item ' + i ,
88
+ id : i ,
89
+ description : ' Description ' + i ,
90
+ imageUrl : ' https://picsum.photos/150/70/?random' ,
91
+ });
92
+ }
93
+ ` ` `
94
+
58
95
- If you are developing a NativeScript Vue app, you need to install the plugin in you app.js file:
59
96
60
97
` ` ` js
You can’t perform that action at this time.
0 commit comments