-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[feature] multidrag pre-select and disable user select #2183
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
Comments
Have you tried to use Sortable.utils.select to select the items you want to pre-select |
I didn't before you said, I guess I looked over it in the documentation, anyway, now I tried, and it seems to error
|
try 'utils' with lowercase 'u', I guess |
that is what I tried, and that errors this.
|
Still looking for a solution for this, is there any? |
That last call should work if the plugin is mounted correctly/if the fully mounted complete version of Sortable is used. |
everything works expect for the call @tomasmenezes its a ts error, but even when running a development build it won't work. Does it mean sortable can't be ran in ts? As the error is very clear and doesn't go away no mather what or where I try to put it. PS: This was just an try, normally I use it after creating the function |
aa I see the function does work in development build, however, 2 problems, 1 is the one I described above. Which is that it will error fataly in production build due to the ts error. Another one is that I would like to select the items being selected based on the choosen item which is (going to be) moved I tried achieving this using:
Which didn't work directly, I still need to first select the item I am going to move, and then it works. But not on the first try instantly moving it. Anyone an idea if this is possible? The end result of this would be to create pre-set groups of categories, with items inside them. If you move a category all products inside it will move with the category, and you can move any category you want while its items will move with it. |
Seemed to be no solution for this. Now mapped each group inside 1 element and created them as sortable each. |
So I am in need of a function in the multidrag plugin, which allows you to pre-select specific items in a list without the user needing to select them. I tried achieving this by assigning the
selectedClass
to the items which I want to pre-select, however this didn't work, and after looking in to the module, its probably because the item is also added to themultiDragElements
array inside the MultiDrag.js file. Which doesn't seem to be exported in any way, so there won't be a way to add your own items to this.I think this would be easily achievable by exporting the
multiDragElements
array so that you can add or remove items from it to achieve pre-selected behaviour.Another function I would need with the function described above, is a variable which would disable users to select and unselect items. Which can just be a boolean.
The end behaviour of this (as an example) would be that you can have groups, which have items inside of them, and if you drag the group the items will drag with the group. Instead of moving just the group without the items with using default Sortable, or the user needing to select each product before moving the category to move them with their category.
The text was updated successfully, but these errors were encountered: