0

For a project I would like to use Angular and ui-sortable to be able to sort a list, divided in rows and columns. It is not a table, instead I want to use a div, using bootstrap classes to add rows and col-md classes to appear as a table. I made a codepen that resembles the functionality I want to achieve. Rows can be sorted by drag and drop, with a bit of a hassle. But within a row I can't change the sort order of the columns.

An example for the codepen I am using: I want to be able to change element A | B to B | A. And I would also like to be able to move A | B under C | B

<div class="form-container" ui-sortable="sortableRows" ng-model="filtered">
    <div ng-repeat="row in filtered">
      <div class="row rowborder">
        <div ui-sortable="sortableCols" ng-model="row">
           <div ng-repeat="col in row">
             <div class="col-md-6 colborder">
                 {{col.entry}}
             </div>
           </div>
        </div>           
     </div>
</div>

1 Answer 1

0

I got a solution to my problem from another user. There was a structural problem in the HTML. You can find the solution in this codepen.

<div class="form-container" ui-sortable="sortableRows" ng-model="filtered">
      <div ui-sortable="sortableCols" ng-model="row" ng-repeat="row in filtered" class="row rowborder">
        <div ng-repeat="col in row" class="col-md-6 colborder">
          {{col.entry}}
        </div>
      </div>
 </div>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.