0

如何使用 nativescript-angular 制作一个预先填充的 radautocompletetextview?

这就是我尝试这样做的方式:

HTML:

<RadAutoCompleteTextView id="rice-cake" (didAutoComplete)="onTokenSelected($event)" marginTop="40px" style="border-width:0.5;border-radius:5px;border-color:#E6E6E6;"
                            #autocmp [items]="dataItems" suggestMode="Suggest" displayMode="Plain">
                            <SuggestionView tkAutoCompleteSuggestionView suggestionViewHeight="150">
                      `enter code here`<ng-template tkSuggestionItemTemplate let-item="item">
                                    <StackLayout orientation="vertical" padding="10">
                                        <Label [text]="item.text"></Label>
                                    </StackLayout>
                                </ng-template>
                            </SuggestionView>
                        </RadAutoCompleteTextView>

打字稿:

 this.autocomplete = 
          <RadAutoCompleteTextView>view.getViewById(this.page,"rice-cake");  
                console.log(JSON.stringify(this.autocomplete))
                var token = new TokenModel(_result.dish, undefined);
                this.autocomplete.addToken(token)  
4

1 回答 1

0

您可能想检查一下:

https://github.com/telerik/nativescript-ui-feedback/issues/323

于 2017-10-15T00:36:19.573 回答