javascript - 具有可编辑元素的表单在 angular-x-editable 示例代码中应具有 `editable-form` 属性

标签 javascript angularjs x-editable

当我在自己的项目中尝试 x-editable 提供的示例代码时,我遇到了一个问题: 当我在我自己的应用程序中尝试在 JSFiddle 中完美运行的这段代码时(只有一些小的修改,例如 Controller 的名称),我收到此错误消息:

    Form with editable elements should have `editable-form` attribute. <span class="ng-scope ng-binding editable" editable-text="user.name" e-name="name" e-form="rowform" onbeforesave="checkName($data, user.id)" e-required=""> angular.js:11707:18

Form with editable elements should have `editable-form` attribute. <span class="ng-scope ng-binding editable" editable-select="user.status" e-name="status" e-form="rowform" e-ng-options="s.value as s.text for s in statuses"> angular.js:11707:18

Form with editable elements should have `editable-form` attribute. <span class="ng-scope ng-binding editable" editable-select="user.group" e-name="group" onshow="loadGroups()" e-form="rowform" e-ng-options="g.id as g.text for g in groups"> angular.js:11707:18

Form with editable elements should have `editable-form` attribute. <span class="ng-scope ng-binding editable" editable-text="user.name" e-name="name" e-form="rowform" onbeforesave="checkName($data, user.id)" e-required=""> angular.js:11707:18

Form with editable elements should have `editable-form` attribute. <span class="ng-scope ng-binding editable" editable-select="user.status" e-name="status" e-form="rowform" e-ng-options="s.value as s.text for s in statuses"> angular.js:11707:18

Form with editable elements should have `editable-form` attribute. <span class="ng-scope ng-binding editable" editable-select="user.group" e-name="group" onshow="loadGroups()" e-form="rowform" e-ng-options="g.id as g.text for g in groups"> angular.js:11707:18

Form with editable elements should have `editable-form` attribute. <span class="ng-scope ng-binding editable" editable-text="user.name" e-name="name" e-form="rowform" onbeforesave="checkName($data, user.id)" e-required=""> angular.js:11707:18

Form with editable elements should have `editable-form` attribute. <span class="ng-scope ng-binding editable" editable-select="user.status" e-name="status" e-form="rowform" e-ng-options="s.value as s.text for s in statuses"> angular.js:11707:18

Form with editable elements should have `editable-form` attribute. <span class="ng-scope ng-binding editable" editable-select="user.group" e-name="group" onshow="loadGroups()" e-form="rowform" e-ng-options="g.id as g.text for g in groups">

它阻止我编辑表格中的一行

这是我使用的 fiddle : http://jsfiddle.net/NfPcH/93/

我通读了 github 上关于这个问题的整个帖子,但没有一个解决方案对我有用。 这段代码怎么可能在 jsfiddle 上没有问题但在我的项目中没有问题?会不会是配置问题?我通过 bower 使用最新版本的 xeditable。

如果有人给我提示或指出正确的方向,我将不胜感激。

最佳答案

好的,我解决了我的问题。如果您有类似的问题,这可能会有所帮助:

在我的应用程序中,还有另一个标签包围了大部分网站,包括可编辑表。这会给 xeditable 带来麻烦。所以错误信息是正确的。我通过删除此表单解决了它。另一种方法是使外部表单也可编辑。

因此,如果您遇到相同的错误消息,请务必检查您的 html 源代码并查找标签。

关于javascript - 具有可编辑元素的表单在 angular-x-editable 示例代码中应具有 `editable-form` 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32483680/

相关文章:

javascript - Jasmine karma 单元测试 "Error: Unexpected request: GET/Content/json/3420_layer0.json"

javascript - 通过 object.id 进行 Angular 跟踪

python - 可以使用 AngularJS+Flask 堆栈来完成推送通知吗?

angularjs - 如何在 Angular-Xeditable 中使用 mask ?

javascript - Angular 7 - 没有具有未指定名称属性的表单控件的值访问器

javascript - Uncaught Error : [$injector:modulerr] Failed to instantiate module matchpoint due to:

javascript - X-Editable 和 Bootstrap 4

javascript - 使用 x 可编辑内联模式自动保存在数据库中,无需在表上添加提交按钮

javascript - JS中语句的含义

javascript - 如何在回发中显示面板?