Angular-xeditable Editable (Bs3) with date and ng-repeat

守給你的承諾、 提交于 2020-01-13 12:06:58

问题


I try to extend a specific example of Angular-xeditable Editable row (Bs3) adding the field "date of birth"

I've created a jsfiddle to describe the problem

http://jsfiddle.net/ffgj62q0/ (right link)

<div ng-app="app" ng-controller="Ctrl">
<table class="table table-bordered table-hover table-condensed">
    <tr style="font-weight: bold">
        <td style="width:35%">Name</td>
        <td style="width:20%">Date of b</td>
        <td style="width:10%">Status</td>
        <td style="width:10%">Group</td>
        <td style="width:25%">Edit</td>
    </tr>
    <tr ng-repeat="user in users">
        <td>
            <!-- editable username (text with validation) --> <span editable-text="user.name" e-name="name" e-form="rowform" onbeforesave="checkName($data, user.id)" e-required>
      {{ user.name || 'empty' }}
    </span>

        </td>
        <td> <a href="#" editable-bsdate="user.dob" e-name="dob" e-datepicker-popup>
        {{ (user.dob | date:"dd/MM/yyyy") || 'empty' }}
      </a>

        </td>

The popup doesn't appear. :-(

I found this example that works with one date field.

http://plnkr.co/edit/Y4ilZ4rITYnjAyq2xAUa?p=preview

Any hint to solve this specific problem, please?

Regards C.


回答1:


I forked your fiddle (also updated some resources, for example set angularjs to 1.4.8 on the javascript settings of the jsfiddle - "FRAMEWORKS AND EXTENSIONS", and removed angular.min.js from the jsFiddle's external resources).

And then I just added some missing stuff, like explained on the angular-xeditable site (http://jsfiddle.net/cewm89y3/5/)

  1. I added the missing dependency of ui-bootstrap, both to the jsfiddle's resources and to the module.
  2. Also added e-is-open and e-ng-click attributes just as in the example from angular-xeditable,

... and in my fiddle the datepicker opens.




回答2:


It is problem with X-editable js.

changed x-editable.js

to angular-xeditable - 0.1.9



来源:https://stackoverflow.com/questions/31413774/angular-xeditable-editable-bs3-with-date-and-ng-repeat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!