IfnotFr / PopConfirm

A simple action confirmation plugin for jQuery based on Twitter Bootstrap Popover
MIT License
99 stars 35 forks source link

How can I popup the box conditionally? #32

Closed LJTDiSZ closed 8 years ago

LJTDiSZ commented 8 years ago

Hi, This is a nice plugin.

Is there a way to popup the box only when some conditions satisfied?

For example, there are multiple rows, each row have a check box. and there is a button, clicking the button will delete all the checked/selected rows. Using your plugin, it will popup a confirmation box before delete all the selected rows.

The question is, if none of rows are selected, clicking the button still popups the confirmation box.

Is there a way to NOT popup the confirm box when click the button if none of rows are selected?

Thanks.

IfnotFr commented 8 years ago

There is no way to programatically disable the popconfirm handler without any selector already on the item.

But you can disable with not :

$('.popconfirm-items').not('.disabled').popconfirm();