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

POST the JSON new nested collection #52

Open
weedkiller opened this issue Feb 24, 2017 · 2 comments
Open

POST the JSON new nested collection #52

weedkiller opened this issue Feb 24, 2017 · 2 comments

Comments

@weedkiller
Copy link

Hi, this is very nice, when I try to POST a nested collection,

  • I am not getting uniquely identified attribute values with Id, this is confusing the server side while trying to bind to a model object for saving/add new and deleting.
  • Also is there a template on the div row or table row, I can use to clone/append where the repeater assigns hidden attribute values to the new row, so the collection rows are uniquely indexed when POST

Thanks

@DubFriend
Copy link
Owner

Not sure if I understand completly.

If you need to add custom behavior, the "show" callback might help with your use case.

$('.my-repeater').repeater({
  show: function () {
    // the value of "this" is set to the newly created html element
    setNewElementWithMyCustomBehavior(this)
  }
})

The library creates a template internally by cloning the first list item. The library isn't really set up to do this more explicitly.

@weedkiller
Copy link
Author

Its cloning fine, but when POST for the new rows, inside this, the id of the the new row does not seem unique and having trouble saving at server

  • What should I query to get the unique values, How to ensure unique values also append to any child rows of the new row (nested collection/rows)
  • Second my rows have a button like approve , reject, when clicked how to ensure they pass the correct Id/value of the clicked row?

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