-
Notifications
You must be signed in to change notification settings - Fork 571
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
Update Multiple Fields #57
Comments
perhaps we could do something like this
|
This would be extremely helpful, +1 |
Can you confirm this isn't already possible by handling the ajax:success event? |
where would we but the ajax:success? i mean if you have lots of fields you'll be managing a lot of it. it would be nicer to have some kind of way to do it from best_in_place |
I can confirm. Here's a simple example using jquery:
|
artellectual, i had the exact same problem: price, quantity, sum displayed in a row and below the table total price of all products, user can change quantity and sum with total price should be updated.
Then i add jquery
But i have a problem with displaying information. Firstly, i wanted to make that only column with sums is in partial and gets updated. But i havent figured out how to display it properly. I tried to move the whole table into partial and when u use it for the first time - everything loads up perfectly, but then best_in_place stops working... |
The solution to broken best_in_place after loading the whole table was pretty easy
|
its not the cleanest solution though, you have to create a custom order_sum action. when you update the object using best_in_place it returns the json data anyway it should update the field using that new data, instead of loading the data twice. |
Hi everyone, I've tried to implement this on my fork of the project, on the update_with branch : https://github.com/VonD/best_in_place = best_in_place object, field, :update_with => :other_field Or = best_in_place object, field, :update_with => [:other_field1, :other_field2] In case you need to update an attribute that is never editable, i've introduced a new block syntax : - best_in_place object do |bip|
= bip.input field, :update_with => [:other_field1, :other_field2]
= bip.input other_field1
= bip.no_edit other_field2 Thanks, I'd like to have opinions before submitting a pull request |
Hello everyone, We think that the best option for now is to use AJAX callbacks in order to update what you want to be updated in the view. It might not be the best possible solution but, for now, is the most practical approach. We do not plan to implement this whole feature, but feel free to provide a pull request with tests and the implementation of this. |
Was wondering if you have any plans to support multiple fields update.
as in for example
i have a field called unit_price
and a field called quantity
and another field called total
displayed in a row.
I want it to be such that if I update the quantity and on the server side i have a call back function that updates the total when we re display the data it actually updates the 'total' display field as well?
The text was updated successfully, but these errors were encountered: