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

Add an empty row to the collection #34

Closed
dmolineus opened this issue Dec 10, 2013 · 6 comments
Closed

Add an empty row to the collection #34

dmolineus opened this issue Dec 10, 2013 · 6 comments

Comments

@dmolineus
Copy link

I really like the idea of collections and fieldsets in Aura, but I struggle at some points. Here is another one.

At the moment an collection can only be rendered if any data is filled in (by a model, by post etc.). It would be great add an empty fieldset row or at least to get the fieldset so I could create empty rows in the View of the collection.

public function addEmptyFieldset()
{
    $index = $this->count();
    $new = $this->newFieldset($index);
    $this->fieldsets[$index] = $new;

    return $new;
}
@harikt
Copy link
Member

harikt commented Dec 11, 2013

What is the purpose of empty field set you are looking for ?

@dmolineus
Copy link
Author

Let me explain it with the used contact form example in the Aura docs. I want to provide a form where multiple entries of the collection can be added. The number of items should not be limited.

I would like to render an empty fieldset in this cases:

  1. User registers: There is no data filled yet, so the collection would contain no fieldset rows. I want to display an empty row so the first item can be inserted
  2. User edit data: User wants to add a new contact type. There need to be a new row.

I want to use a generic form renderer where I can not know which fieldset is used in the collection. So I need a way getting the fieldset.

@harikt
Copy link
Member

harikt commented Dec 12, 2013

ping @pmjones

@harikt
Copy link
Member

harikt commented Dec 12, 2013

could you please send a PR, so @pmjones can check the idea? ( preferable with test case ) or you can wait to hear his thoughts.

@harikt
Copy link
Member

harikt commented Dec 12, 2013

one thing for now, extend the class ;) .

@dabba39
Copy link

dabba39 commented Mar 29, 2015

the collection class should not contain rendering concerns. empty fieldsets can be triggered via javascript.

@pmjones pmjones closed this as completed Apr 3, 2015
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

4 participants