javascript - Angularjs-UI sortable multiple div list -
I'm trying to sort to work.
& lt; Ul ui-sortable = 'Data.sortableOptions' ng-model = "dp.claims" class = "list-volatile" & gt; & Lt; Li ng-repeat = "c in dp.claims" & gt; & Lt; Div & gt; {{C.field1}} & lt; / Div & gt; & Lt; Div & gt; {{C.field2}} & lt; / Div & gt; & Lt; Div & gt; {{C.field3}} & lt; / Div & gt; & Lt; / Li & gt; & Lt; / Ul & gt; I can not catch and drag the important part of this question is in the 3 div in the
I accept, I do not know what this line is in the docs : "The ui-sortable element should have only one ng-repeat and not any other element (above or below)."
And I am able to work it with a table.
Any insights?
Yes, docs say "Only one ng-repeat should be in the uriy-sortable element and someone There should not be other elements (above or below). " Which makes it harder to divide 3 in the li, however, there is a solution
You can use TG-Dynamic-Directional (AT) to solve it. Do not forget to include it, and put 'tg.dynamic directive' in your dependency. Actually you take part in the middle of the li tag, in this case 3 divisces, and you put it in another file and link to it. & lt; Ul ui-sortable = 'data.sortableOptions' ng-model = "dp.claims" class = "list-volatile" & gt; & Lt; Li ng-repeat = "c in dp.claims" & gt; & Lt; / Li & gt; & Lt; / Ul & gt; Then insert insertside into another file, like innards.html:
and replace the indoor like this:
& lt; Ul ui-sortable = 'data.sortableOptions' ng-model = "dp.claims" class = "list-unstyled" & gt; & Lt; Li ng-repeat = "c in dp.claims" & gt; & Lt; TG-Dynamic-Directive NG-Model = "C" TG-Dynamic-Direction-View = "getView" & gt; & Lt; / TG-Dynamic-Instructions & gt; & Lt; / Li & gt; & Lt; / Ul & gt; And something like this in your controller:
$ scope.getView = function (item) {if item {return 'innards.html'; Return tap; }; Anyways, the docs go very well on it, I realize that this question is very old, but I went into it myself and it was working so it is expected that it Helps someone else.
Comments
Post a Comment