从kendoWindow获取数据

get data from kendoWindow

本文关键字:数据 获取 kendoWindow      更新时间:2023-09-26

目前,我只想打开一个窗口,并获取用户输入的数据值。下面是我的代码:

function execGetKey() {
    var win = $('#w').kendoWindow({
        modal: true,
        resizable: false,
        title: 'Please Enter a Key',
        visible: false,
        activate: function () {
            $('#t').select();
        },
        editItem: function(e) {
            var dataItem = this.dataItem($(e.target).closest("tr"));
            kendo.bind($("#w"), dataItem);
            e.preventDefault();
            kendo.bind(win, dataItem);
        },
        close: function (e) {
            console.log("win:");
            for (var prop in win) {
                if (win.hasOwnProperty(prop)) {
                    console.log(prop);
                    console.log(win[prop]);
                }
            }
            console.log("e:");
            for (var prop in e) {
                if (e.hasOwnProperty(prop)) {
                    console.log(prop);
                    console.log(e[prop]);
                }
            }  
        }
    }).data('kendoWindow');
    win.center().open();   
}

这里是kendoWindow的所有属性,但是在所有这些属性中我没有找到用户输入的值:

match.config.js:640 element
match.config.js:641 [div#w.k-window-content.k-content, context: div#w.k-window-content.k-content]
match.config.js:640 _events
match.config.js:641 Object {activate: Array[1], close: Array[1]}
match.config.js:640 options
match.config.js:641 Object {prefix: "", name: "Window", animation: Object, title: "Please Enter a Key", actions: Array[1]…}
match.config.js:640 appendTo
match.config.js:641 [body, prevObject: A.fn.init[1], context: document, selector: "body"]
match.config.js:640 wrapper
match.config.js:641 [div.k-widget.k-window, prevObject: A.fn.init[1], context: div#w.k-window-content.k-content]
match.config.js:640 dragging
match.config.js:641 s {owner: c.e…d.init, _draggable: _.e…d.init}
match.config.js:640 touchScroller
match.config.js:641 false
match.config.js:640 _resizeHandler
match.config.js:641 jQuery.extend.proxy.proxy()
match.config.js:640 _marker
match.config.js:641 97742b0d
match.config.js:640 _closing
match.config.js:641 false

有人有什么建议吗?TIA。

更新:

这是我在调试和检查关闭事件中发现的,但尚不清楚,我如何在js代码中访问此"10117434-000"值?

c.e…d.init {element: A.fn.init[1], _events: Object, options: Object, appendTo: A.fn.init[1], wrapper: A.fn.init[1]…}
   //...
   element: A.fn.init[1]0: div#w.k-window-content.k-content
      //...
      childNodes: NodeList[3]
          0: textbaseURI: "http://localhost:41678/Match.mvc/Config"childNodes: NodeList[0]length: 0__proto__: NodeListdata:        //...
          1: input#taccept: ""accessKey: "" 
              //...
              value: "10117434-000"
              //...

OK,明白了——这是我需要的值,尽管这绝对是一种从剑道对话框中获取值的令人费解的方式:

e.sender.element[0].childNodes[1].value