Starting from version 1078, the API prefix has been changed from hbs to qg. The original prefix hbs is still supported.
API | Description |
|---|---|
Hides the soft keyboard. | |
Displays the soft keyboard. | |
Updates the default value displayed in the keyboard input box. | |
Listens for a keyboard input event. | |
Stops listening for a keyboard input event. | |
Listens for the event that a user taps the confirm button on the keyboard. | |
Stops listening for the event that a user taps the confirm button on the keyboard. | |
Listens for a keyboard hide event. | |
Stops listening for a keyboard hide event. |
Parameter | Type | Mandatory | Description |
|---|---|---|---|
success | function | No | Callback function triggered upon a successful API call. |
fail | function | No | Callback function triggered upon a failed API call. |
complete | function | No | If a function is passed, it will be called regardless of whether the API call succeeds or fails. |
qg.hideKeyboard({
success : function () {
console.log("hideKeyboard success" );
},
fail:function(){
console.log("hideKeyboard fail");
},
complete:function() {
console.log("hideKeyboard complete");
}
}); Parameter | Type | Mandatory | Description |
|---|---|---|---|
defaultValue | string | Yes | Default value displayed in the keyboard input box. |
maxLength | number | Yes | Maximum length of the text in the keyboard input box. |
multiple | boolean | Yes | Indicates whether to enter multiple lines. |
confirmHold | boolean | Yes | Indicates whether to hold the keyboard after the confirm button is tapped. |
confirmType | string | Yes | Type of the confirm button in the lower right corner of the keyboard. This parameter affects only the text content of the button. For details, please refer to Valid values of confirmType. |
success | function | No | Callback function triggered upon a successful API call. |
fail | function | No | Callback function triggered upon a failed API call. |
complete | function | No | If a function is passed, it will be called regardless of whether the API call succeeds or fails. |
qg.showKeyboard ({
defaultValue : 'default value',
maxLength : 666,
multiple : true,
confirmHold : true,
confirmType : 'done',
success : function () {
console.log("showKeyboard success" );
},
fail:function(){
console.log("showKeyboard fail");
},
complete:function() {
console.log("showKeyboard complete");
}
}); Parameter | Type | Mandatory | Description |
|---|---|---|---|
value | string | Yes | Current value input via the keyboard. |
success | function | No | Callback function triggered upon a successful API call. For details, please refer to Parameters in the success callback function. |
fail | function | No | Callback function triggered upon a failed API call. For details, please refer to Parameters in the fail callback function. |
complete | function | No | If a function is passed, it will be called regardless of whether the API call succeeds or fails. |
qg.updateKeyboard ({
value : 'update value',
success : function (res) {
console.log("updateKeyboard success" + res.errMsg);
},
fail:function(res){
console.log("updateKeyboard fail" + res.errMsg);
},
complete:function() {
console.log("updateKeyboard complete");
}
}); Parameter | Type | Mandatory | Description |
|---|---|---|---|
callback | function | Yes | Callback function for the keyboard input event. For details, please refer to Parameters in callback. |
qg.onKeyboardInput(
function(res){console.log("onKeyboardInput value = " + res.value);}
); Parameter | Type | Mandatory | Description |
|---|---|---|---|
callback | function | Yes | Listener function passed to OnKeyboardInput. |
Listens for the event that a user taps the confirm button on the keyboard.
Parameter | Type | Mandatory | Description |
|---|---|---|---|
callback | function | Yes | Callback function for the keyboard input event. For details, please refer to Parameters in callback. |
qg.onKeyboardConfirm(
function(res){console.log("onKeyboardConfirm value = " + res.value);}
); Listens for a keyboard hide event.
Parameter | Type | Mandatory | Description |
|---|---|---|---|
callback | function | Yes | Callback function for the keyboard hide event. For details, please refer to Parameters in callback. |
qg.onKeyboardComplete(
function(res){console.log("onKeyboardComplete value = " + res.value);}
);