gapi.cloudsearch.widget.resultscontainer.Builder
결과 컨테이너 빌더 빌더를 사용하고 컨테이너 생성자를 직접 호출하지 않습니다.
생성자
Builder
new Builder()
예
// Builds a results container.
function onload() {
gapi.client.init({
'apiKey': '<your api key>',
'clientId': '<your client id>',
// Add additional scopes if needed
'scope': 'https://www.googleapis.com/auth/cloud_search.query',
'hosted_domain': '<your G Suite domain>',
});
const resultscontainer =
new gapi.cloudsearch.widget.resultscontainer.Builder()
.setSearchResultsContainerElement(document.getElementById('search_result'))
.build();
const searchBox = new gapi.cloudsearch.widget.searchbox.Builder()
.setInput(document.getElementById('input'))
.setAnchor(document.getElementById('input').parentElement)
.setResultsContainer(resultscontainer);
.build();
}
gapi.load('client:cloudsearch-widget', onload);
메서드
빌드
build()가 ResultsContainer를 반환합니다.
결과 컨테이너를 빌드합니다.
- 반환 값
-
non-null ResultsContainer
setAdapter
setAdapter(adapter)가 Builder를 반환합니다.
선택사항. 사용자 환경을 맞춤설정하도록 어댑터를 설정합니다.
매개변수 |
|
---|---|
adapter |
값은 null이 아니어야 합니다. |
- 반환 값
-
non-null Builder
this
setFacetResultsContainerElement
setFacetResultsContainerElement(facetResultsContainerElement)가 Builder를 반환합니다.
측정기준 결과의 컨테이너 요소를 설정합니다. 하위 노드를 포함할 수 있는 유효한 요소여야 합니다.
매개변수 |
|
---|---|
facetResultsContainerElement |
요소 값은 null이 아니어야 합니다. |
- 반환 값
-
non-null Builder
this
setIncludePagination
setIncludePagination(includePagination)이 Builder를 반환합니다.
선택사항. 기본값은 true입니다. true로 설정된 경우 결과 컨테이너에 기본 페이지로 나누기 UI를 포함합니다.
매개변수 |
|
---|---|
includePagination |
부울 |
- 반환 값
-
non-null Builder
this
setResultsContainer
setResultsContainer(resultsContainer)가 빌더를 반환합니다.
필수사항: 컨테이너의 요소를 설정합니다. 하위 노드를 포함할 수 있는 유효한 요소여야 합니다.
매개변수 |
|
---|---|
resultsContainer |
요소 값은 null이 아니어야 합니다. |
- 지원 중단됨
- 반환 값
-
non-null Builder
this
setSearchApplicationId
setSearchApplicationId(searchApplicationId)가 Builder를 반환합니다.
선택사항. 요청에 사용할 검색 애플리케이션 ID를 설정합니다. 'searchapplications/' 접두사가 있어야 합니다.
매개변수 |
|
---|---|
searchApplicationId |
문자열 |
- 반환 값
-
non-null Builder
this
setSearchResultsContainerElement
setSearchResultsContainerElement(searchResultsContainerElement)가 Builder를 반환합니다.
필수사항: 컨테이너의 요소를 설정합니다. 하위 노드를 포함할 수 있는 유효한 요소여야 합니다.
매개변수 |
|
---|---|
searchResultsContainerElement |
요소 값은 null이 아니어야 합니다. |
- 반환 값
-
non-null Builder
this