hiroprotagonist / jquery.mobile.actionsheet

An actionsheet for jquerymobile
103 stars 34 forks source link

Using close causes an unbind error #26

Closed justechn closed 12 years ago

justechn commented 12 years ago

I see in your example that you can include a cancel button in the actionsheet, but when I try I get an unbind error.

Here is my actionsheet (still in development)

     <a href="#" data-role="button" data-theme="c">Delete</a>
     <a href="#" data-role="button" data-theme="c">Copy</a>
     <a href="#" data-role="button" data-theme="c">Move</a>
     <a href="#" data-role="button" data-theme="c" data-rel="close">Cancel</a>

here is the error jquery.mobile.actionsheet.js:72 Uncaught TypeError: Cannot call method 'unbind' of undefined

Do you have any ideas?

justechn commented 12 years ago

The problem seems to occur when you have more than one link pointing to the same actionsheet.

For example I have a list of items and when I click on one item in the list I want it to open an actionsheet which has a bunch of options, like edit, delete, copy, move, and cancel. So to make things cleaner I have just one actionsheet and every item in the list points to the same one.

hiroprotagonist commented 12 years ago

Actionsheet is a tradeoff between "easy to use" and functionality. I think a pure JS approach will work better for your use case. Take a look at this one: https://github.com/jtsage/jquery-mobile-simpledialog