Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
SearchBoxAdapter
giao diện
Bộ chuyển đổi của hộp tìm kiếm
Phương thức
createSuggestionElement
createsuggestedionElement(đề xuất) trả về Phần tử
Triển khai phương thức này để ghi đè hoạt động kết xuất đề xuất.
Thông số
đề xuất
Đối tượng
Đối tượng đề xuất trong phản hồi
Giá trị không được rỗng.
Trả bóng
Phần tử non-null Element được tạo dựa trên đề xuất.
decorateSuggestionElement
decorateSuggestionElement(element, suggestion)
Triển khai phương thức này để trang trí một đề xuất, chẳng hạn như thay đổi CSS.
Thông số
yếu tố
Phần tử
Vật dụng bạn có thể trang trí
Giá trị không được rỗng.
đề xuất
Đối tượng
Đối tượng đề xuất trong phản hồi
Giá trị không được rỗng.
interceptSuggestRequest
insertsuggestedRequest(request) trả về đối tượng
Triển khai phương thức này để thêm các tham số bổ sung theo yêu cầu.
Thông số
request
Đối tượng
Yêu cầu ban đầu
Giá trị không được rỗng.
Trả bóng
non-null Object yêu cầu Yêu cầu đã cập nhật
interceptSuggestResponse
interceptSuggestResponse(response)
Triển khai phương thức này để đọc phản hồi đề xuất trước khi kết xuất. Đối tượng phản hồi ở chế độ chỉ có thể đọc. Nếu lệnh gọi không thành công, phản hồi sẽ chứa thông báo lỗi.
Nếu một yêu cầu đề xuất mới được đưa ra trong khi có một yêu cầu đang chờ xử lý, thì yêu cầu trước đó sẽ bị huỷ và phương thức này sẽ không được gọi.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 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. |"]]