Base solution for your next web application
Open Closed

Datepicker in table scrollable #979


User avatar
0
teddylim created

Hi,

I am new to ASP.Net Zero and ABP

I want to add 2 input fields using date-picker & date-range-picker in person.phonebook page, it works fine for date-range-picker but not for date-picker,

is it possible to add datepicker in tablescrollable? because the date-picker also works fine if i put it outside from the table

<div class="list-group-item" ng-repeat="person in vm.persons" ng-class="{'person-editing':person==vm.editingPerson}">
                        <h4 class="list-group-item-heading">
                            {{person.name}} {{person.surname}}
                            <span class="person-buttons">
                                <button ng-click="vm.editPerson(person)" title="@L("Edit")" class="btn btn-circle btn-icon-only green">
                                    <i class="icon-pencil"></i>
                                </button>
                                <button ng-if="vm.permissions.deletePerson" ng-click="vm.deletePerson(person)" title="@L("Delete")" class="btn btn-circle btn-icon-only red">
                                    <i class="icon-trash"></i>
                                </button>
                            </span>
                        </h4>
                        <p class="list-group-item-text">
                            {{person.emailAddress}}
                        </p>

                        <div class="table-scrollable" ng-if="person==vm.editingPerson">

                            <table class="table table-hover">

                                <thead>
                                    <tr>
                                        <th style="width:10%"></th>
                                        <th style="width:15%">@L("Type")</th>
                                        <th style="width:15%">@L("PhoneNumber")</th>
                                        <th style="width:20%">@L("ContactName")</th>
                                        <th style="width:20%">@L("CompanyName")</th>
                                        <th style="width:20%">@L("DOB")</th>
                                    </tr>

                                </thead>
                                <tbody>
                                    <tr ng-repeat="phone in person.phones">
                                        <td>
                                            <button ng-click="vm.deletePhone(phone, person)" class="btn btn-sm btn-default">
                                                <i class="icon-trash"></i>
                                            </button>
                                        </td>
                                        <td>{{vm.getPhoneTypeAsString(phone.type)}}</td>
                                        <td>{{phone.number}}</td>
                                        <td>{{phone.companyname}}</td>
                                        <td>{{phone.contactname}}</td>
                                        <td>{{phone.dob}}</td>
                                    
                                    </tr>

                                    <tr>
                                        <td>
                                            <button ng-click="vm.addPhone(person.newPhone, person)" class="btn btn-sm green">
                                                <i class="fa fa-floppy-o"></i>
                                            </button>
                                        </td>
                                        <td>
                                            <select name="Type" ng-model="person.newPhone.type">
                                                <option value="0">@L("PhoneType_Mobile")</option>
                                                <option value="1">@L("PhoneType_Home")</option>
                                                <option value="2">@L("PhoneType_Business")</option>
                                            </select>
                                        </td>
                                        <td><input type="text" name="Number" ng-model="person.newPhone.number" /></td>
                                        <td><input type="text" name="CompanyName" ng-model="person.newPhone.companyname" /></td>

                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td><input type="text" name="ContactName" ng-model="person.newPhone.contactname" /></td>
                                        <td><input date-range-picker type="text" options="vm.dateRangeOptions" min="vm.dateRangeOptions.min" max="vm.dateRangeOptions.max" class="form-control date-picker" ng-model="vm.dateRangeModel" /></td>

                                        <td>
                                            <div class="form-group">
                                                <input class="form-control date-picker" type="text" value="" ngmodel= "person.newPhone.dob"/>
                                            </div>

       
                                        </td>

                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>

thanks


2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Just change your date-picker definition to

    <input class="form-control date-picker" ui-jq="datepicker" type="text" value="" ngmodel="person.newPhone.dob" />
    
  • User Avatar
    0
    teddylim created

    That worked.
    Thank you so much