Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以防止引导输入预先填充/清除元素吗?
这是一个示例bootply.com/79110
请注意我如何使用自己的代码更新元素。当警报出现时,您将看到它有效,但随后元素值被删除。我想防止预先输入更新元素。
通常,该updater函数返回项目..
updater
updater: function (item) { /* do whatever you want with the selected item */ return item; },
因此,如果您没有updater返回项目的功能,则不会设置输入..
updater: function (item) { /* do whatever you want with the selected item */ alert("selected "+item); },
Demo on Bootply