Closed AkbarAlam closed 7 years ago
Hi Akbar, thanks for using it, I am glad you like it, currently I am working on total rewrite of library, it will be much easier to use/maintain etc...
To your problem.
I need to know exact rules you want achieve.. for example if item from items1 can be dropped between item2 or only inside items2 into values array? Etc..
Please write me all use cases you want to support in your example.
Hey, Item1 can be dropped only inside item2 value array.So the value array is empty initially. Once the item1 is dropped it should go inside the value array. here I am struggling
I am sorry I am busy now.. too much deadlines.. :/ Preparing code in jsfiddle, codepen.. or similar is much faster for me to solve problems.. but dont worry, I will answer you soon. It is possible and not so difficult as it looks at the first glance.
Here is codepen of your case: https://codepen.io/luckylooke/pen/LyoWzR
Thanks but there is a small issue. the value of item 2 should be empty initially.
{
key:'info',
value: [ ]
}
once the data from item 1 is dropped in item 2 it will go directly in the value. then it should look like
$scope.items2 = [
{
'key' : 'info',
'value' : [ {
'name' : 'x',
'age' : '4'
}]
},
{
'key' : 'info',
'value' : [ {
'name' : 'y',
'age' : '5'
}]
},
{
'key' : 'info',
'value' :[ {
'name' : 'y',
'age' : '5'
}]
},
];
Oh, I am sorry, I was in a hurry and I made some mistakes.. now fixed in same codepen. Check it please, if it is OK than please accept also answer on stackoverflow, thanks ;)
Thank you so much. just a question if I want to do it with a model how should I write the service?
Synced with models: https://codepen.io/luckylooke/pen/KmLGbM
Thank you so much :)
How can I drop element from one container to anothre container's nested array Object?This is one container item
i want to drop each element in a new container it should be
how should i write my dragularService