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

Is remove worked right? #10

Open
macik opened this issue May 15, 2014 · 4 comments
Open

Is remove worked right? #10

macik opened this issue May 15, 2014 · 4 comments
Assignees
Labels

Comments

@macik
Copy link

macik commented May 15, 2014

init Phoenix with complex selector:

$('#form1,#form2').find('input,textarea,select').phoenix({
        namespace: 'mySpace',
        maxItems: 250,
        saveInterval: 5000
     });

but when I try to remove storage data it's not worked —

$('#form1,#form2').find('input,textarea,select').phoenix('remove'); // this not worked

because Phoenix tries to remove from default nameSpace phoenixStorage.

@kugaevsky kugaevsky added the bug label Jul 11, 2014
@merkushov
Copy link

Please, fix it.

@hendorog
Copy link

I have the same issue - phoenix breaks when the default options are overridden. It works fine if you just use the defaults.

@kugaevsky kugaevsky self-assigned this Aug 7, 2015
@maximelebreton
Copy link

+1

@vlatka-sinisa
Copy link

vlatka-sinisa commented Apr 6, 2016

We had the same problem and solved it (workaround?) by expanding this line:

     if (typeof option === "string") {
        this.action = option;
      }

Into this:

     if (typeof option === "string") {
        this.action = option;
      }else{
          this.action = option.action;
      }

After that you need to define "action" not as string "remove", but as an object:

$(".selector").phoenix({ namespace: "test", "action": "remove" });

You can still use

$(".selector").phoenix('remove');

But that will use the default namespace (phoenixStorage).

Hope it helps...

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

6 participants