First: great module to finetune content with the power of views.
It would be handy to have an auto save option for draggable views via ajax when dragger is released.
This could replace the star marking changed items and the text "* Changes made in this table will not be saved until the form is submitted."

cheers, Ronald

Comments

ManyNancy’s picture

Yep that would be a great feature. Thanks!

aren cambre’s picture

Title: auto save order via ajax » Auto save Order changes via AJAX after drag
Version: 6.x-3.4 » 6.x-3.x-dev

+1

aren cambre’s picture

Issue tags: +Usability
rokr’s picture

This is the companion issue in core: #504378: Auto-save draggable forms

randomuser’s picture

+1

Maybe a plugin for the Ajax module like ajax_views_refresh?

http://drupal.org/project/ajax_views_refresh
http://drupal.org/project/ajax

btopro’s picture

I actually have a module that adds ajax refreshing to the book module called outline designer. http://drupal.org/project/outline_designer . I'm sure the code isn't horribly different from what's performed there to pull it off.

It also adds context menu / in line editing of titles and things like that but I'd love to port functionality into draggable if possible as I'm looking to make my project plug/n/play with things other then just books (menus, views, etc).

sirkitree’s picture

+1

hampshire’s picture

I would be interested as well.

yannickoo’s picture

subscribe

aren cambre’s picture

Title: Auto save Order changes via AJAX after drag » Auto save with AJAX after each order change
Version: 6.x-3.x-dev » 7.x-1.x-dev

Assuming new features go in latest version.

drupalina’s picture

Is this feature in the latest 6.x-3x-dev ?
Given that the lists in views can be pretty long, we can't expect the end-user to realise that they have to scroll down to the bottom of the page in order to see the info-message or the "Save" button. I saw the screencasts for http://drupal.org/project/outline_designer - it would be awesome is some of that AJAX-saving code would be adopted in DraggableViews.

burgs’s picture

subscribing

btopro’s picture

Version: 7.x-1.x-dev » 6.x-3.x-dev
Status: Active » Needs work

Something similar to this I would think get this integrated -- http://drupal.org/node/1016248#comment-3906774

I'll try taking a closer look at where this could go / what detection to do but it seems like if the displayed information is book related that outline designer could be told to hijack it via:

if (module_exists('outline_designer')) {
    if ($form_id == 'book_admin_edit') {
      _outline_designer_book_admin_form_alter($form, $form_state, $form_id, 'outline_designer/ajax/');
    }
  }
danny_joris’s picture

subscribing

btopro’s picture

outline designer 1.3 introduces a module called outline child pages which opens up ways of integrating outline designer with other book-like projects. I'll take a look tomorrow and see if there's anything I can do to make certain draggable views work with outline designer's ajax save functionality.

carn1x’s picture

subscribing

jantimon’s picture

For D7 there is a patch (#1268824: Ajax Support).
However it does not save form onchange but only onclick as you cannot hook into the change event right now (#1268530: drupal_add_tabledrag: Add javascript hooks for module writers).

ari-meetai’s picture

This is interesting. With that patch to tabledrag it would be possible.

rokr’s picture

Version: 6.x-3.x-dev » 7.x-2.x-dev

Assuming new features go in latest version.

Just realized how snappy the ajax works. Would be great to have an option to auto save order.

ygerasimov’s picture

Status: Needs work » Postponed

Lets postpone this issue till the core tabledrag.js will have event we can hook into. See #17 for details.

dippers’s picture

This is a code snippet I use in a custom js file to auto submit a draggable view whenever the row order changes. It also hides the 'view has changed' warning message. The draggable view must be ajax enabled via the UI.

  Drupal.behaviors.draggableAutosave = {
    attach: function(){
      if (typeof Drupal.tableDrag == 'undefined') {
        return;
      }
      for (var prop in Drupal.tableDrag){
        if (prop.substring(0, 14) == 'draggableviews'){
          var table = Drupal.tableDrag[prop];
          table.onDrop = function() {
            $('.tabledrag-changed-warning').hide();
            $(this.table).parent().find('#edit-actions input').triggerHandler('mousedown');
          }
        }
      }
    }  
  }
ygerasimov’s picture

Status: Postponed » Fixed

Wow! Well done Mike! I have added this javascript and committed it b84d605

dippers’s picture

It was really posted as a snippet that could be modified as required. For committing it really needs an admin interface that turns autosubmit on/off and passes that through Drupal.settings. As it stands it will autosubmit ALL ajaxed draggable views.

ygerasimov’s picture

It is intended behavior to autosubmit ajaxed draggable view. It is implemented in list display already.

zdean’s picture

Not sure if I should open new issues, but there are 2 problems related to #22:

1. the name of the js file (I think) should be draggableviews_table.js and not draggableviews_table.js.js
2. if there are multiple draggable views on a page, it seems to only work on the first view. The 2nd, 3rd, etc. views still show/require "save" to save the reorder.

dippers’s picture

On point 2 the selector to find the submit button should be find('.form-actions input') in the two places it occurs to allow for multiple submit buttons on the page. This change is probably also relevant to the list view version.

zdean’s picture

#26 did not work for me...the "save" buttons now appear for all of the views on the page, including the first view.

*edit: using #26, I was able to get the "save" buttons to hide; however, none of the views now automatically save the reorder...and since the save buttons are hidden, there's no way to save the reorder.

dippers’s picture

@zdean it is working fine here. Do you have a publicly accessible url showing it not working?

Status: Fixed » Closed (fixed)
Issue tags: -Usability

Automatically closed -- issue fixed for 2 weeks with no activity.

stiknoltz’s picture

Issue summary: View changes
Status: Closed (fixed) » Needs review
StatusFileSize
new1.32 KB

I ran into an issue when having multiple forms on a page containing a draggableviews enabled view.

The ID of the submit button has an integer appended and incremented such that your draggableviews .views-form submit input may be #form-submit--3 or some other number.

This patch generalizes the 'find' target such that it shouldn't be an issue.

drupwell’s picture

I cannot get AJAX autosave to work in listviews or tableviews before/after patching #31. But if I, after patching #31, edit the following in draggableviews_table.js, then autosave works fine for tableviews at least, Save-button is still visible though.

From: $table.parent().find('#edit-actions input').triggerHandler('mousedown');
To: $table.parent().find('#edit-actions #edit-submit').triggerHandler('mousedown');

BR / Fredrik

  • ygerasimov committed b84d605 on 8.x-1.x
    Issue #715966 by Dippers,ygerasimov: Autosave javascript for table...
istryker’s picture

Category: Feature request » Bug report
Status: Needs review » Closed (duplicate)
istryker’s picture