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

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

Comments

Projects
None yet
2 participants

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>

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.

Owner

arthurgouveia commented Apr 16, 2013

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?

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/arthurgouveia/prettyCheckable/issues/11#issuecomment-16441557
.

Owner

arthurgouveia commented Apr 16, 2013

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

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