It would be awesome if the entire row in a views table had one save button at the end so you don't have to click save per field. Also it would be great to have a single save button for the entire table.
| Comment | File | Size | Author |
|---|---|---|---|
| #32 | editablefields.zip | 1.52 KB | off |
Comments
Comment #1
bmx269 commentedOr have the option to save automatically and not need a save button.
Comment #2
damien tournoud commentedWe now have the ability to autosave on simple form fields. I guess this obsoletes this issue?
Comment #3
mstrelan commentedThere is now no fallback for non javascript users. You might also want to disable the ajax edit function in case some fields were dependent on other fields. Eg you have a field "availability" and if the node is "available" then the price then becomes mandatory. If this is saved by ajax then you could have an item that is available but has no price.
Comment #4
damien tournoud commentedAre you talking about states-style dependency?
Comment #5
mstrelan commentedI'm not sure, I don't think so. An old D5 site I'm upgrading had a hard coded table that let you adjust availability and price and when you hit save it validates with custom submit handler that available items must have a price.
Basically my client doesn't like AJAX submission and I can understand why. Suppose you were editing a node and you changed a few values then realised it was the wrong node you were editing. There is no way to revert your changes, whereas if the whole view was submitted only once at the end you could just reload the page or even have a form reset button. Also if you create a table view in the Seven theme the autocomplete throbber looks really ugly and causes the whole page to jump a little bit to make space for it to appear, only to disappear again shortly after.
Comment #6
damien tournoud commentedMoving the issues back to the main project.
Comment #7
damien tournoud commentedComment #8
krlucas commentedSoooo we need to consolidate all the EF form elements per row/page/whatever into a single form? This is a great idea, but harder than just ajaxing the individual forms into the page.
Comment #9
JohnnyX commentedSelect save method would be a great feature for editablefields!
Ajax auto save and a edit button just works fine but I also would like (and need) a "global" save changes" button to save all the changes once after confirmation click. Also a nice additional possibility should be the row based save button but I think with a lower priority...
subscribe
Comment #10
orlando-rincon commentedIt would be an excellent option.
Suscribing
Comment #11
JohnnyX commentedI don't use editablefields at the moment because without a global save button as a "confirm changes" option I could loose content without a chance to recover it.
Comment #12
JohnnyX commentedAny update here? Will a save button added in a future release?
Comment #13
krlucas commented@JohnnyX speaking for myself this seems like a reasonable and useful request. If you want to submit patches or otherwise sponsor the development of this feature I'm sure myself and the other maintainers would be all ears :-).
I think a page-wide submit button should probably come first since it could be Views-agnostic.
Comment #14
ymeiner commentedI feel like this subject came up once before...
I needed the use of editable fields and I understand the need of users to have a save button or data is not saved. Here is what i did to make it happen. It's going to be long so sit back, relax and read carefully.
This change was tested on text/select/combo fields and image fields. sooner or later i will have to do something with reference fields and i hope i will have time to update this post.
I chose to do all my changes on the JS side, I just use the ajax capability of every field which means that it's still a separate save process to every field and i would like to turn it to one bulk update but this is a start.
1. changes to the Drupal.behaviors.editablefields_submit function
I removed the click trigger on field changes and replaced it with an attribute. This way i can sign to the button what fields need to be saved.
$this.find('input.form-submit').attr('tosave','true');For image fields I created an attribute on the submit button that remembers the last fid. I also made the button hidden.
2. creating a button. (I used doc.ready to the button creation, later in the process i will create a function that runs only when needed)
This is the nice part but it is also assuming that the whole page is one form. It was enough for me. I was looking for the lowest parent that is a parent of all fields so I actually used a function that I found on Stack overflow named .commonAncestor
$parent=$('.editable-field input[type="submit"][name="submit-"]').commonAncestor()Then we need to append the button :
And to the click event. for regular fields - find all submit buttons that have a "to-save" (and change it to false); for images - find all changed fids (and change to the new fid); shoot clicks to all of them.
That is it. It has to be improved, this is a beginning of an idea. my preference is to turn the whole thing to one ajax request and to have a bulk save on the php side.
attached is my js file (it has one more change involving the drop-down/enter problem)
Comment #15
charlie-s commentedCan you attach the JS file that you mentioned?
Comment #16
JohnnyX commentedOr a patch?
Comment #17
mmilo commentedIf we take the following approaches in mind:
How do we approach this?
The problem is let's say there are 50 nodes in a view. How do we update them all properly via AJAX and not have things interrupted? Using a batch seems against the flow of things but I don't see another way. The idea that we are updating a large number of nodes at once is a batch after all.
Comment #18
JohnnyX commentedA "global" save button would be great. A button per row maybe nice.
But I think a button for each field is to much...
As additional option use auto save is also fine.
Comment #19
Frederic wbase commentedWhat's the current status of this issue
Comment #20
nicodv commentedI´m interested in a fix, anyone want to help?
@ymeiner can you post that patch/module that you talked about?
Thanks
nico
Comment #21
charlie-s commentedI'm trying to implement this behavior by building a Field Group (drupal.org/project/field_group) display widget called "Form". This means you can drag any number of fields into a field group on the display of a node (or any entity) and set that field group type to "form". You then get the standard form elements for each item and a submit button. I think it's a clean approach to this problem since you get to group similar fields where appropriate.
The page that contains the work-in-progress module is: http://drupal.org/node/1482876
although something that's blocking this from working with a stock copy of field_group is: http://drupal.org/node/1482958
Comment #22
kristen polI see a save button on the bottom of the page but it doesn't appear to work.
Comment #23
a.milkovskyI can see the "Save" button at the bottom of the view too.
I've noticed that the button apears because of line
And button is created in the file views.module. There is a check
but I didn't manage to hide it too
I've chosen this solution http://drupal.org/node/1245324#comment-5002336 temporary
Comment #24
auraell commentedsubscribing
Comment #25
kristen pol@auraell - Fyi. There is a "follow" button on the top of issues so you can click on that for ones you'd like to watch. Cheers!
Comment #26
nravens commentedHas anyone found a way to hide the "Save" button that appears at the bottom and doesn't really do anything other than redirect to the homepage?
Comment #27
Road Kill commentedI solved this problem by using css. You can hide the button just by using the node id which is unique for each page.
.page-user- .view-id-my_account #views-form-my-account-block #edit-actions--2 #edit-submit--2 {
display: none !important;
Comment #28
nravens commentedThanks.
This worked for me:
#homebox-block-views_update_courses-block #edit-actions #edit-submit {
display: none !important;
}
Some of the other CSS I tried also hid the login button so I need to check that nothing else that shouldn't be hidden is being hidden...
Comment #29
omidehghanZD commentedmy dears, i have problem with save button og editablefields.for some fields after i click save button i am redirected to front page.
edit field, save button
after click save, i'm redirected to front page.
i dont know why some editable field after click on save button redirect to home page and some field no redirected and work correctly.
have any idea?
Comment #30
pinueve commenteduse this module instead https://www.drupal.org/project/editableviews+1 #28, i added a new view with same fields, same content, diferent url, modify view machine name, and added #28 clases with .view-machine-name
Comment #31
off commentedpinueve, if i use editableviews, every row resaves entity and makes a couple of rules executions in my case.
If someone has js file from comment #14, please, upload it. I'm trying to make it, but it doesn't work(
Comment #32
off commentedThis is my attempt to reproduce the solution from comment #14
Comment #33
graysonecooper commentedAs a pretty hacky fix for the complex field issue (e.g., firing an ajax request on every checkbox change), I had some basic JS to handle updating when a users mouse leaves a field (in addition to hiding the save buttons, per #28):
Example:
Caveats: