Sunday, August 30, 2015

pass more than one value to next kendodropdownlist by filter

see the below code to do this:

var branch_dropdown_id = $("#branch_id").kendoDropDownList({
                optionLabel:"--Select Branch--",
                dataTextField:"name",
                dataValueField:"branch_id",
                dataSource:{
                    serverFiltering:true,
                    transport:{
                        read:{
                            dataType: "json",
                            type: "POST",
                            url: url
                        }
                    }
                },
                change:function(e){
                    $("#class_id").data("kendoDropDownList").enable();
                    $scope.branid = this.value();
                    var classid = $("#class_id").data("kendoDropDownList");
   
                    classid.dataSource.filter({
                        field: "branch_id",
                        value: this.value(),
                        operator: "eq"
                    });
                    classid.value(0);                                       
                }
            }).data("kendoDropDownList");


var class_id = $("#class_id").kendoDropDownList({
                autoBind:false,
                optionLabel:"--Select Class--",
                dataTextField:"class_name",
                dataValueField:"class_id",
                dataSource:{
                    serverFiltering:true,
                    transport:{
                        read:{
                            dataType: "json",
                            type: "POST",
                            url: url
                        }
                    }
                },
                change:function(e){
                    $("#section_id").data("kendoDropDownList").enable();                       
                    var sectionid = $("#section_id").data("kendoDropDownList");   
                    sectionid.dataSource.filter({
                        field: "classid",
                        value: this.value(),
                        operator: "eq",
                        field1: "bnid",
                        value1: branch_dropdown_id.value(),
                        operator1: "eq"
                    });                   
                    sectionid.value(0);
                }
            });

No comments:

Post a Comment

Suomen kieli (Imperfekti)

In Finnish, the imperfekti is the past tense that describes actions that happened in the past, like the English simple past (e.g., "I ...