Gurpinder
Gurpinder

Reputation: 652

ng-sortable not working when drooping an li to an empty ul?

I am facing an issue when i drop an li element to a ul which is empty it is unable to drop that li element. It is working fine if ul contain li. Please help me. Thanks in advance

<ul>
                    <li class="heading-row">
                        <div class="cell-col cell-1">
                            <strong>Group</strong>
                        </div>
                        <div class="cell-col cell-2">
                            <strong>#</strong>
                        </div>
                        <div class="cell-col cell-3">
                            <strong>Nick Name</strong>
                        </div>
                        <div class="cell-col cell-4">
                            <strong>Company</strong>
                        </div>
                        <div class="cell-col cell-5">
                            <strong>Rating</strong>
                        </div>
                        <div class="cell-col cell-6">
                            <strong>Car Info</strong>
                        </div>
                        <div class="cell-col cell-7">
                            <strong>Car Type</strong>
                        </div>
                        <div class="cell-col cell-8">
                            <strong>Capacity</strong>
                        </div>
                    </li>
                    <!--ng repeat-->


                    <li id="rowd.id" ng-repeat="rowd in rowData.data">
                        <div>
                            <div class="cell-col cell-1">{{rowd.name}}
                            </div>
                            <div class="cell-col cell-group-2">
                                <div class="cell-item-rw">
                                    <ul class="data card-list ng-pristine ng-untouched ng-valid driver_data"
                                        as-sortable="waitaddSortOptions" ng-model="rowd.data">
                                        <li class="{{rowq.id}} rowq" data-ng-repeat="rowq in rowd.data"
                                            ng-dblClick="selectedDriver(rowq)" as-sortable-item>
                                            <div as-sortable-item-handle="" class="as-sortable-item-handle">

Upvotes: 1

Views: 328

Answers (1)

N.Raval
N.Raval

Reputation: 549

Just set the style ng-style="{'min-height': '20px'}" to li tag

 <li class="{{rowq.id}} rowq" data-ng-repeat="rowq in rowd.data" ng-dblClick="selectedDriver(rowq)" ng-style="{'min-height': '20px'}" as-sortable-item> 

Now you are able to drop element in empty list.

Upvotes: 0

Related Questions