在剔除observableArray中编辑项目 [英] Edit item in knockout observableArray

查看:65
本文介绍了在剔除observableArray中编辑项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个示例,其中我可以将observableArray显示为带有编辑/删除链接的普通文本.可以从单独的表单添加/编辑项目. 我无法通过编辑链接来编辑记录,无法添加新记录!

I am looking for an example where i can show an observableArray as normal text with edit / delete links. Items can be added/edited from a separate form. I am not able to edit the record from edit link it add new record!

 self.editItem = function (p) {
        //edit code
        ////???????
    };

此处是示例

推荐答案

正如答案中提到的,您应该使用with绑定来编辑任何特定记录.在这里,我根据您的需要创建了一个演示.

As other mentioned in there answers, you should use with binding for editing any particular record. Here i have created a demonstration according to your need.

http://jsfiddle.net/85afB/1/

这篇关于在剔除observableArray中编辑项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆