Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with "title" param in confirm and prompt? #60

Closed
thearabbit opened this issue May 18, 2015 · 12 comments
Closed

Problem with "title" param in confirm and prompt? #60

thearabbit opened this issue May 18, 2015 · 12 comments
Labels

Comments

@thearabbit
Copy link

I try set title

alertify.alert(title, message); // word fine
alertify.confirm(title, message, onok);// title don't work
alertify.prompt(title, message, value, onok);// title don't work

please help me.

@MohammadYounes
Copy link
Owner

The none working constructors you are mentioning do not exist! If you take another look at the docs, the confirm dialog has the following constructors:

  alertify.confirm(title, message, onok, oncancel);

  //overloads:

   alertify.confirm(message);
   alertify.confirm(message, onok);
   alertify.confirm(message, onok, oncancel);

and the prompt dialog has the following:

  alertify.prompt(title, message, value, onok, oncancel);

  //overloads:

  alertify.prompt(message);
  alertify.prompt(message, value);
  alertify.prompt(message, value, onok);
  alertify.prompt(message, value, onok, oncancel);

Thanks.

@thearabbit
Copy link
Author

Thanks, so I can use alertify.confirm(title, message, function(){...}, null) because I don't use oncancel.

@MohammadYounes
Copy link
Owner

Yes.

@sshokko
Copy link

sshokko commented Apr 18, 2016

Hello!

You can write code like this

var confirm = alertify.confirm(title, message, onok);// title don't work

confirm.set({'title':'Your title'});

var prompt = alertify.prompt(title, message, value, onok);// title don't work

prompt.set({'title':'Your title'});

It works to me

@MohammadYounes
Copy link
Owner

@sshokko overloads selection is based on parameters count (not type), thus:

var confirm = alertify.confirm(title, message, onok); // this matches 3-parameters constructor 
           // alertify.confirm(message, onok, oncancel);

// while 

var confirm = alertify.confirm(title, message, onok, null); //matches 4-parameters constructor 
           // alertify.confirm(title, message, onok, oncancel);

Thanks!

@rowej83
Copy link

rowej83 commented Oct 15, 2018

@sshokko overloads selection is based on parameters count (not type), thus:

var confirm = alertify.confirm(title, message, onok); // this matches 3-parameters constructor 
           // alertify.confirm(message, onok, oncancel);

// while 

var confirm = alertify.confirm(title, message, onok, null); //matches 4-parameters constructor 
           // alertify.confirm(title, message, onok, oncancel);

Thanks!

I tried your example for prompt with a title and I'm having the same issues as above. also, your example has a typo ( missing a comma in example after "prompt title" )

this.$alertify.prompt("prompt title","This is prompt", "default value", (evt, value)=>
    	this.$alertify.success("ok: " + value)
    , () => this.$alertify.error("cancel")
    )

This results in just a Alertifyjs as title. Not as expected. also, the success/error do not get triggered.

@MohammadYounes
Copy link
Owner

@rowej83

I tried your example for prompt with a title and I'm having the same issues as above. also, your example has a typo ( missing a comma in example after "prompt title" )

I can't find the typo you mentioned ?

This results in just a Alertifyjs as title. Not as expected. also, the success/error do not get triggered.

Prompt constructor is different than confirm, See prompt default constructor and overloads.

@rowej83
Copy link

rowej83 commented Oct 16, 2018

Are you testing it your self? I literally took the example from the link you sent and it isn't working. Check this. it's not working. The code is in the TestComponent.vue

Edit Vuex exercise

Also, the typo is on the vue-alertify instructions . you have this:
promptWithTitle:function(){
this.$alertify.prompt("prompt title""This is prompt", "default value", (evt, value)=>
this.$alertify.success("ok: " + value)
, () => this.$alertify.error("cancel")
)
}

which is missing the comma between "prompt title" and "this is prompt"

so it should be

promptWithTitle:function(){
this.$alertify.prompt("prompt title","This is prompt", "default value", (evt, value)=>
this.$alertify.success("ok: " + value)
, () => this.$alertify.error("cancel")
)
}

@MohammadYounes
Copy link
Owner

@rowej83

Also, the typo is on the vue-alertify instructions . you have this:

I didn't write any vue instruction ?

@MohammadYounes
Copy link
Owner

@rowej83 Ah, seems you confused this with the Vue wrapper repo.

Based on the wrapper code, you should use promptWithTitle instead, see updated fork of your sample

Edit Vuex exercise

I see the typo in the README, You may notifier the author about it by opening an issue over there.

Thanks.

@rowej83
Copy link

rowej83 commented Oct 16, 2018

@rowej83 Ah, seems you confused this with the Vue wrapper repo.

Based on the wrapper code, you should use promptWithTitle instead, see updated fork of your sample

Edit Vuex exercise

I see the typo in the README, You may notifier the author about it by opening an issue over there.

Thanks.

Sorry, I did mistaken it for another repo. I added issues on that repo.

@thearabbit
Copy link
Author

Good for Vue AlertifyJS!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants