The "user question list" component shows all user question by default. If a content is selected it then shows only its user questions.
How to create this component.
sdk.component('userQuestionList', '#target', options);
By default, this component looks like this:
This is the HTML component. For example, the "#inbenta" target is:
<div id="inbenta"></div>
Available options to set in this component
Name | Type | Default | Description |
---|---|---|---|
offset | integer | 0 | Initial number where the list starts showing user questions |
length | integer | 20 | Maximum number of shown user questions. Minimum: 1. Max: 100. |
Methods can be used in this component.
Method | Description |
---|---|
showUQList() |
Show the full list of User Questions of the instance |
getPreviousUQ |
Get previous user questions (pagination) |
getNextUQ |
Get next user questions (pagination) |
showUserQuestionsByContent(contentId:string) |
Get user questions from a content. |
This component does not have any subcomponents.
Events to listen on this component:
Name | Params | Description |
---|---|---|
user_question_click | userQuestion : user question object clicked |
Click on User Question |
pagination | length : length used in pagination, offset : offset used in pagination |
Click on pagination button |
This component does not track any data.
Labels of this component. The default labels of each component can be rewritten in the SDK creation configuration.
Name | Default | Description |
---|---|---|
USER_QUESTIONS | User questions |
The text for the user questions list title |
RELATED_UQ | Related user questions |
The text for user question list title when a content is selected |
var userQuestionList = sdk.component('userQuestionList', '#list');
userQuestionList.showUserQuestionsByContent(2);
var userQuestionList = sdk.component('userQuestionList', '#list');
userQuestionList.showUserQuestionsByContent(2);
userQuestionList.showUQList();