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

Document use of the collection javascript for normal collections as well as polycollections #5

Open
merk opened this issue Sep 17, 2013 · 9 comments

Comments

@merk
Copy link
Contributor

merk commented Sep 17, 2013

No description provided.

@pmartelletti
Copy link

@merk this is working already but needs documentation? Or still a WIP the rendering?

Cheers,

@merk
Copy link
Contributor Author

merk commented Jul 20, 2014

The javascript helper works great but is primarily suited towards using polycollections. It means it will still work exceptionally well for a normal collection. The only real difference between the two is multiple 'prototype' DOM nodes.

https://github.com/infinite-networks/InfiniteFormBundle/blob/master/Resources/doc/collection-helper.md

If you're talking about the polycollection - the dilemma is that there is more than one way to render a form type for a polycollection but none of them are general enough to provide templates by default.

@pmartelletti
Copy link

@merk yes, I was talking about rendering for polycollection. I will take a look to that document, and see if I can make it work as, indeed, I need several prototypes and for rendering the forms and that's why bascially, I'm using this bundle. 😄

@merk
Copy link
Contributor Author

merk commented Jul 20, 2014

Ah, this issue is not about polycollection rendering but the helper documentation. The link wont give you much insight. Right now the best place to see an example of how to render the polycollection is here:

#11 has an example from one of our applications.

@pmartelletti
Copy link

ah! Thanks a lot for that link! Surely it would be of much help! 😄

@pmartelletti
Copy link

@merk not sure if I understand the example very well.

I've managed to create a button with the different type of prototypes, but not being able to render them. Does the following lines of JS do the work or some extra markup is needed?

$(function () {
        $('[data-form-widget=collection]').each(function () {
            new window.infinite.Collection(this, $(this).siblings('[data-prototype]'));
        });
    });

Thanks a lot!

@merk
Copy link
Contributor Author

merk commented Jul 21, 2014

Can you create a new issue with your templates and form types please?

@pmartelletti
Copy link

@merk I've managed to get it working. Thanks for your help! If I found some time this week, I will raise a PR so that we can work a little bit on documentation of this, as I think is the most valuable feature of the bundle. 😄

@merk
Copy link
Contributor Author

merk commented Jul 21, 2014

Thanks, I'd appreciate any contribution you can add to the documentation

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