Kendo DropDown列表OnChange事件不起作用

时间:2017-07-27 10:04:57

标签: jquery kendo-ui onchange

这是我的剑道下拉列表:

import sqlite3
import pandas as pd
from odo import odo, discover, resource, dshape

conn = sqlite3.connect(dbfile)
c = conn.cursor()

c.execute("DROP TABLE <table1>")
c.execute("VACUUM")

importfile = pd.read_csv(csvfile)

odo(importfile,'sqlite:///<db_path>::<table1'>)

ValueError: Column names of incoming data don't match column names of existing SQL table Names in SQL table:

这是OnChange事件,它无法获得我的下拉值  更改时列出:

function modelProducer(container, options) {
    $('<input  name="ModelProducer"  data-type="string"\">')
        .appendTo(container)
        .kendoDropDownList({
            dataSource: modelProducerResult,
            dataTextField: "model",
            dataValueField: "model",
        });

}

1 个答案:

答案 0 :(得分:1)

使用select event

更改您的代码
function modelProducer(container, options) {
    $('<input  name="ModelProducer"  data-type="string"\">')
        .appendTo(container)
        .kendoDropDownList({
            dataSource: modelProducerResult,
            dataTextField: "model",
            dataValueField: "model",
           select: onSelect(e)
        });

}

然后更改没有意义的控件。你想检查&#34; id&#34;在窗口对象中。

$(document).ready(function() {
    function onSelect(e) {

            if (e.item) {
                var dataItem = this.dataItem(e.item);
                kendoConsole.log("event :: select (" + dataItem.text + " : " + dataItem.value + ")");
            } else {
                kendoConsole.log("event :: select");
            }

    }
});