This is a migrated thread and some comments may be shown as answers.

datasource query question

0 Answers 147 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
ShootingStar
Top achievements
Rank 1
ShootingStar asked on 16 May 2012, 08:49 AM
Hello

I'm quite newbie. I don't understand what is my problem exactly.
Following is my code.
$("#cmbCompany").width(350).kendoComboBox({
        placeholder: "Select company",
        serverFiltering: true,
        dataTextField: "Company",
        dataValueField: "ClientNo",
        dataSource: {
            transport: {
                read: "/Admin/GetAllCompany"
            }
        },
        change: function () {
            var value = this.value();
            if (value) {
                employeeDataSource.query({ companyNo: value });
                employee.enable();
            } else {
                employee.enable(false);
            }
 
          employee.value("");
        }
    });
     
    var employeeDataSource = new kendo.data.DataSource({
        transport: {
          dataType: "json",
          read: "/Admin/GetEmployeesByCompany"
        }
    });
 
    var employee = $("#cmbEmployee").width(300).kendoComboBox({
        autoBind: false,
        placeholder: "Select employee",
        dataTextField: "Name",
        dataValueField: "Email",
        dataSource: employeeDataSource
    }).data("kendoComboBox");

First time I select #cmbCompany combo box, it load data and shows propely at #cmbEmployee.
But second time, I select a new value at #cmbCompanyasd , it works nothing.
It did nothing, even not send http request.

How can I work it properly?

Thank you in advance.

No answers yet. Maybe you can help?

Tags
Data Source
Asked by
ShootingStar
Top achievements
Rank 1
Share this question
or