Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
SearchBoxAdapter
interfejs
Adapter pola wyszukiwania
Metody
createSuggestionElement
createSuggestionElement(sugestia) zwraca Element Element
Zaimplementuj tę metodę, aby zastąpić renderowanie sugestii.
Parametr
sugestia
Obiekt
Obiekt sugestii z odpowiedzi
Wartość nie może być wartością null.
Akcje powrotne
non-null Element Element utworzony na podstawie sugestii.
decorateSuggestionElement
decorateSuggestionElement(element, suggestion)
Za pomocą tej metody możesz udekorować sugestię, np. zmienić arkusz CSS.
Parametr
element
Element
Element, na którym można udekorować
Wartość nie może być wartością null.
sugestia
Obiekt
Obiekt sugestii z odpowiedzi
Wartość nie może być wartością null.
interceptSuggestRequest
interceptSuggestRequest(request) zwraca obiekt
Zaimplementuj tę metodę, by dodać do żądania dodatkowe parametry.
Parametr
Poproś
Obiekt
Pierwotne żądanie
Wartość nie może być wartością null.
Akcje powrotne
non-null Object prosi o zaktualizowane żądanie
interceptSuggestResponse
interceptSuggestResponse(response)
Zaimplementuj tę metodę, aby odczytywać sugerowaną odpowiedź przed renderowaniem. Obiekt odpowiedzi jest tylko do odczytu. Jeśli wywołanie nie powiedzie się, odpowiedź będzie zawierała błąd.
Jeśli zostanie wysłane nowe żądanie sugestii w czasie oczekiwania na odpowiedź, poprzednie zostanie anulowane, a metoda nie zostanie wywołana.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-07-25 UTC."],[],[],null,["# Interface: SearchBoxAdapter\n\nSearchBoxAdapter\n================\n\ninterface\n\nThe Adapter of search box\n\nMethods\n-------\n\n### createSuggestionElement\n\ncreateSuggestionElement(suggestion) returns Element\n\nImplement this method to override rendering of a suggestion.\n\n| #### Parameter ||\n|------------|------------------------------------------------------------------|\n| suggestion | Object A suggestion object from response Value must not be null. |\n\nReturns\n\n: `non-null Element` element Element built based on a suggestion.\n\n### decorateSuggestionElement\n\ndecorateSuggestionElement(element, suggestion)\n\nImplement this method to decorate a suggestion, such as change CSS.\n\n| #### Parameter ||\n|------------|------------------------------------------------------------------|\n| element | Element Element you can decorate on Value must not be null. |\n| suggestion | Object A suggestion object from response Value must not be null. |\n\n### interceptSuggestRequest\n\ninterceptSuggestRequest(request) returns Object\n\nImplement this method to add extra params in request.\n\n| #### Parameter ||\n|---------|-----------------------------------------------------|\n| request | Object The original request Value must not be null. |\n\nReturns\n\n: `non-null Object` request The updated request\n\n### interceptSuggestResponse\n\ninterceptSuggestResponse(response)\n\nImplement this method to read the suggest response prior to rendering. The\nresponse object is read-only. If the call fails, the response\nwill contain the error.\n\nIf a new suggest request is issued while one is pending, the previous\nrequest is cancelled and the method is not called.\n\n| #### Parameter ||\n|----------|-----------------------------------------------------|\n| response | Object The suggest response Value must not be null. |"]]