Closed it3r4-pineda closed 5 years ago
Did you do tns platform clean android
(or ios), after installing the plugin?
error still persists.
Try passing one of these values directly
export declare enum CFAlertStyle { NOTIFICATION = 0, ALERT = 1, BOTTOM_SHEET = 2 }
Ex: If you wanted to use CFAlertStyle.NOTIFICATION
try passing 0 directly.
(just to check if rest of it is working for you),
And if that does work, this could be an import error.
Will this work with vanila JavaScript?
On Mon, Feb 11, 2019, 1:25 AM Shiva Prasad notifications@github.com wrote:
Try passing one of these values directly
export declare enum CFAlertStyle { NOTIFICATION = 0, ALERT = 1, BOTTOM_SHEET = 2 }
Ex: If you wanted to use CFAlertStyle.NOTIFICATION
try passing 0 directly.
(just to check if rest of it is working for you),
And if that does work, this could be an import error.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shiv19/nativescript-cfalert-dialog/issues/21#issuecomment-462153264, or mute the thread https://github.com/notifications/unsubscribe-auth/Ak0UH2xGAsHgG8-Y0_ST1xc8Xx8lLBlZks5vMFX4gaJpZM4azI8E .
var Dialog = require("nativescript-cfalert-dialog");
var cfalertDialog = new Dialog.CFAlertDialog();
//made a functions based on given comment
function CFAlertStyle() {
NOTIFICATION = 0,
ALERT = 1,
BOTTOM_SHEET = 2
}
function CFAlertActionStyle() {
DEFAULT = 0,
NEGATIVE = 1,
POSITIVE = 2
}
function CFAlertActionAlignment() {
START = 0,
END = 1,
CENTER = 2,
JUSTIFIED = 3
}
//show Dialog
cfalertDialog.show({
dialogStyle: CFAlertStyle.BOTTOM_SHEET,
title: "This is a bottom sheet!",
message: "It is shown at the bottom of the screen",
buttons: [{
text: "Okay",
buttonStyle: CFAlertActionStyle.POSITIVE,
buttonAlignment: CFAlertActionAlignment.JUSTIFIED,
onClick: function (response) {
console.log("Inside OK Response");
console.log(response); // Prints Okay
}
},
{
text: "Nope",
buttonStyle: CFAlertActionStyle.NEGATIVE,
buttonAlignment: CFAlertActionAlignment.JUSTIFIED,
onClick: function (response) {
console.log("Inside Nope Response");
console.log(response); // Prints Nope
}
}
]
});
the following does not return an error but doesnt show the dialog either
Umm, you didn't do what I asked you to do.
I want you to directly pass the enum values and see if it works.
Or import it this way const CFAlertActionStyle = require("nativescript-cfalert-dialog").CFAlertActionStyle;
Closing due to inactivity
Make sure to check the demo app(s) for sample usage
Checked
Make sure to check the existing issues in this repository
Checked
If the demo apps cannot help and there is no issue for your problem, tell us about it
Please, ensure your title is less than 63 characters long and starts with a capital letter.
Which platform(s) does your issue occur on?
Error - Using Vanilla Js
An uncaught Exception occurred on "main" thread. com.tns.NativeScriptException: Calling js method onTouch failed
ReferenceError: CFAlertStyle is not defined File: "file:///data/data/org.nativescript.E4/files/app/tns_modules/tns-core-modules/ui/gestures/gestures.js, line: 228, column: 40
StackTrace: Frame: function:'ChangeColor', file:'file:///data/data/org.nativescript.E4/files/app/choose/choose-page.js', line: 40, column: 22 Frame: function:'_executeCallback', file:'file:///data/data/org.nativescript.E4/files/app/tns_modules/tns-core-modules/ui/gestures/gestures.js', line: 282, column: 27 Frame: function:'TapAndDoubleTapGestureListenerImpl.onSingleTapUp', file:'file:///data/data/org.nativescript.E4/files/app/tns_modules/tns-core-modules/ui/gestures/gestures.js', line: 25, column: 17 Frame: function:'GesturesObserver.androidOnTouchEvent', file:'file:///data/data/org.nativescript.E4/files/app/tns_modules/tns-core-modules/ui/gestures/gestures.js', line: 228, column: 41 Frame: function:'', file:'file:///data/data/org.nativescript.E4/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 252, column: 25 Frame: function:'View.handleGestureTouch', file:'file:///data/data/org.nativescript.E4/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 251, column: 18 Frame: function:'TouchListenerImpl.onTouch', file:'file:///data/data/org.nativescript.E4/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 30, column: 19