2017-03-02 3 views
0

私はWebix modalboxを使用しています。 私はこのモーダルボックスに含まれているフォームからデータを受け取る必要がありますが、データを取得する前に消えてしまいます。Webixはフォームデータを取得する前にモーダルボックスを閉じます

this.route = "/detail/"; this.modalSettings = { create: { title: "Новая деталь", width: 500, buttons: ["ДОБАВИТЬ", "ОТМЕНА"], actions: [this.store, this.modalClose] }, show: { title: "" }, edit: {} };

答えて

0

あなたはmodalboxのための参照を格納し、次の

var modal = { 
    title: "Новая деталь", 
    width: 500, 
    buttons: ["ДОБАВИТЬ", "ОТМЕНА"], 
    actions: [this.store, this.modalClose] 
}; 

webix.message.keyboard = false; 
var t = webix.modalbox({ 
    view: "window", 
    position: "center", 
    title: modal.title, 
    text: "<input id='m1' type='text'>", 
    width: modal.width, 
    buttons: modal.buttons, 
    callback: function (result) { 
    if(result === 0) { 
     return false; 
    } 
    var value = t.getElementsByTagName("input")[0].value; 
    webix.message("value: "+value); 
    } 
}); 
ようmodalboxを閉じた後結果読むことができるようなものである

this.modalOpen = function (modal, form) { webix.message.keyboard = false; _Reference.$modal = webix.modalbox({ view: "window", position: "center", title: modal.title, text: form, width: modal.width, buttons: modal.buttons, callback: function (result) { if(result === 0) { return false; } var functionName = modal.actions[result]; if (typeof functionName === "function") { functionName.apply(null); } } }); };

とデータはこの関数に含ま: は、ここでは、コードです

関連する問題