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

How to revert to checkboxes instead of Div containers.. #11

Closed
seattlekyle opened this issue Jan 18, 2013 · 5 comments
Closed

How to revert to checkboxes instead of Div containers.. #11

seattlekyle opened this issue Jan 18, 2013 · 5 comments

Comments

@seattlekyle
Copy link

Is there anyway I can call $('#someElement').prettyCheckable().revert();

I want to revert to just the original instead of the

<input ...>
before knockoutjs removes the items from the collection.

I am using an observableArray in knockout and binding it to a foreach template repeater in a div container.

You can see below in the afterRender event I make it pretty using your plugin

My function :

postRenderCountyCheckboxes = function (elements) {
$(elements[1]).prettyCheckable();
};

Excerpt from my viewModel :

counties([{ name: 'King', id: '3435353252' }, { name: 'Pierce', id: '1435353252' }]);

My template :

<script type="text/html" id="CountiesTemplate"> </script>
@seattlekyle
Copy link
Author

For now I just call $('#containerDiv").empty(); to remove all the checkbox child divs that prettycheckable creates from the parent container. I'm guessing this is probably the best solution.

@arthurgouveia
Copy link
Owner

Hey @seattlekyle! Yesterday I added a function to enable/disable checkboxes and I'm guessing I could also add one to revert the input back to the original state.

But would you mind explaining why would you need this?

@seattlekyle
Copy link
Author

Not sure if I will yet, I'm not full time working on that project anymore,
so I will let you know if I still need it in the future sometime.

On Tue, Apr 16, 2013 at 5:27 AM, Arthur Gouveia notifications@github.comwrote:

Hey @seattlekyle https://github.com/seattlekyle! Yesterday I added a
function to enable/disable checkboxes and I'm guessing I could also add one
to revert the input back to the original state.

But would you mind explaining why would you need this?


Reply to this email directly or view it on GitHubhttps://github.com//issues/11#issuecomment-16441557
.

@arthurgouveia
Copy link
Owner

Thanks. Would you mind closing the issue (feature request), then?

@seattlekyle
Copy link
Author

I will try later

On Apr 16, 2013, at 7:09 AM, Arthur Gouveia notifications@github.com wrote:

Thanks. Would you mind closing the issue (feature request), then?


Reply to this email directly or view it on GitHub.

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

No branches or pull requests

2 participants