1

I'm trying to use sortable in angularjs for drag and drop cards but I have some issue with ngModel Of null how can I fix that?

Lists is array of arrays of objects and stages is array of objects

  <div class="ibox-content animate fadeOut">

<div ng-repeat="row in opportunities.stages">
  <div class="stage stage-{{row.StageId}}" ng-if="row.StageId !== 100">


    <div id="{{row.StageId}}" class="stage-lane" ui-sortable="opportunities.sortableOptions" ng-model="opportunities.lists[$index]"  ng-show="!opportunities.load">
      <div ng-repeat="opportunity in opportunities.lists[$index]>
        <div class="opportunity" date-id="opportunity.OpportunityId">
          <div class="title">{{opportunity.Title ? opportunity.Title : opportunity.CustomerCompanyName}}

          </div>
          <div class="status"></div>
          <div class="closing" ng-show="opportunity.StageId < 10">{{opportunity.ExpectedClosingDate}}</div>
          <div class="closing" ng-show="opportunity.StageId >= 10">{{opportunity.ActualClosingDate}}</div>
          <div class="value">{{opportunity.Value}}</div>
          <div class="company">{{opportunity.CustomerCompanyName}}</div>

        </div>
      </div>
    </div>

  </div>

  <div class="stage stage-{{row.StageId}}" ng-if="row.StageId === 100">

      <div id="stage-{{row.StageId}}" class="stage-lane">

      </div>
  </div>
</div>

Controller

vm.sortableOptions = {
  connectWith: ".stage-lane:not(#stage_100)",
  items : ".opportunity",
  distance: 5,
  forcePlaceholderSize: true,
  tollerance: "pointer",
  placeholder: "sortable-placeholder", 
  receive: setStage
};

0

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.