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

'sortableListsPlaceholder' as id #8

Closed
fjavier-moreno opened this issue Sep 23, 2015 · 4 comments
Closed

'sortableListsPlaceholder' as id #8

fjavier-moreno opened this issue Sep 23, 2015 · 4 comments

Comments

@fjavier-moreno
Copy link

Hi!

Plugin is awsome, I have integrated successfully with no many issues but I have last one that still give me a headache.

I have defined this callback on drop completion:

complete: function(currEl)
            {
                var $tree = $sortable.sortableListsToArray();
                $.ajax({
                    url: '{{ path('admin_category_sort_component') }}',
                    type: 'POST',
                    data: { data : $tree},
                    success: function(data) {
                        //console.debug(data);
                    }
                });
            }

But sortableListsToArray function gave me an element with 'sortableListsPlaceholder':

...
    [order] => 0
 )
[2] => Array
(
    [id] => sortableListsPlaceholder
    [parentId] => 92
    [order] => 0
)
...

Seems sortableListsToArray is not waiting to id restore after drop completion.

I need export tree data on drop finish in order to save hierarchy automatically.

I'm making anything wrong maybe?

Thanks in advance.

@camohub
Copy link
Owner

camohub commented Sep 23, 2015

I am going to check it.

@camohub
Copy link
Owner

camohub commented Sep 23, 2015

There was a bug if user calls toArray from complete callback. It should be fixed.
If you want it immediately use github repository. Bower/NPM is not available yet.

Thanks!

@fjavier-moreno
Copy link
Author

Thanks a lot!!

@camohub
Copy link
Owner

camohub commented Sep 23, 2015

Bower and NPM are available.

Have a nice day.

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