2017-03-02 43 views
0

我正在使用Webix modalbox。 我需要從包含在此模式框中的表單中接收數據,但是在我獲取數據之前它會消失。 這裏是代碼:Webix在獲取表單數據之前關閉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); } } }); };

和數據包括在這個功能就像是

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

回答

0

可以存儲爲modalbox參考,並閱讀關閉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); 
    } 
}); 
後導致
相關問題