Developers

User Question List

Overview

The "user question list" component shows all user question by default. If a content is selected it then shows only its user questions.

Usage

How to create this component.

sdk.component('userQuestionList', '#target', options);

Sample

By default, this component looks like this:

Target

This is the HTML component. For example, the "#inbenta" target is:

<div id="inbenta"></div>

Options

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

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.

Subcomponents

This component does not have any subcomponents.

Events

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

Tracking

This component does not track any data.

Labels

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

Examples

  • First example: Create a User Question List component and show user questions from a content;
    var userQuestionList = sdk.component('userQuestionList', '#list');
    userQuestionList.showUserQuestionsByContent(2);
  • Second example: Reset list and show all user questions from the instance;
    var userQuestionList = sdk.component('userQuestionList', '#list');
    userQuestionList.showUserQuestionsByContent(2);
    userQuestionList.showUQList();