2
でSweetAlert2を使用して、それは私がしかし、それは約束の代わりにコールバックを使用してVISされ、その新機能を利用するためにSweetAlert2を使用していたSweetAlert<a href="http://visjs.org/" rel="nofollow noreferrer">vis.js</a>の項目を編集可能にするにはvis.js
で大丈夫だったコールバックを使用しています。コールバックを使用してjs!
onAdd: function (item, callback) {
prettyPrompt('Add item', 'Enter text content for new item:', item.content, function (value) {
if (value) {
item.content = value;
callback(item); // send back adjusted new item
}
else {
callback(null); // cancel item creation
}
});
},
function prettyPrompt(title, text, inputValue, callback) {
swal({
title: title,
text: text,
type: 'input',
showCancelButton: true,
inputValue: inputValue
}, callback);
}
それでは、どのようSweetAlert2を使用するために、これを変更するには、次のプロンプトのためSweetAlertを呼び出すvis.js 137に
ライン47 57およびライン129へ:ここ
がhttp://visjs.org/examples/timeline/editing/editingItemsCallbacks.htmlから取られたサンプルコードのですか?