敲除获取输入值
Knockout get input value
我已经在网上搜索并尝试阅读手册,但未能找到问题的答案
我有这个带有剔除 js 的可编辑网格:
http://jsfiddle.net/peterf/8FMPc/light/
<input type="text" class="edit" data-bind="value: name.editValue, visible: $root.isItemEditing($data)" />
<label class="read" data-bind="text: name, visible: !$root.isItemEditing($data)" />
我想要做的是,在单击按钮 "Add new Fruit" 并插入水果名称后,通过控制台从 Web 开发人员工具/代码中获取插入的值。
英语不是我的母语;请原谅输入错误。
这是您要找的吗?
http://jsfiddle.net/8FMPc/305/
self.applyFruit = function (fruit) {
// commit the edit transaction
self.editTransaction.notifySubscribers(null, "commit");
console.log(fruit.name());
// hides the edit fields
self.editingItem(null);
};
我已经在网上搜索并尝试阅读手册,但未能找到问题的答案
我有这个带有剔除 js 的可编辑网格:
http://jsfiddle.net/peterf/8FMPc/light/
<input type="text" class="edit" data-bind="value: name.editValue, visible: $root.isItemEditing($data)" />
<label class="read" data-bind="text: name, visible: !$root.isItemEditing($data)" />
我想要做的是,在单击按钮 "Add new Fruit" 并插入水果名称后,通过控制台从 Web 开发人员工具/代码中获取插入的值。
英语不是我的母语;请原谅输入错误。
这是您要找的吗?
http://jsfiddle.net/8FMPc/305/
self.applyFruit = function (fruit) {
// commit the edit transaction
self.editTransaction.notifySubscribers(null, "commit");
console.log(fruit.name());
// hides the edit fields
self.editingItem(null);
};