Get select value from kendo ui comboBox

Get select value from kendo ui comboBox

In this post, is going to share the how to bond the kendo ui Combo Box & how to get the value and text using this.value(), this.text() and we can use as per need.

This combo box wok with filter. If you want to filter the drop-down the it possible.

The Razor view code sample :

<div class="col-lg-12">
     <input type="text" id="txt_filterCustomer"/>
</div>

The JavaScript code sample :

<script type="text/javascript">
    var _empId = mySession().ID;    //This is a Id.

    $(function () {
        $("#txt_filterCustomer").kendoComboBox({
            placeholder: "-- Select Employee --",
            dataTextField: "EmpName",
            dataValueField: "EmpID",
            filter: "contains",
            autoBind: false,
            minLength: 1,
            dataSource: {
                transport: {
                    read: {
                        url:"localhost://8080/API/Company/GetEmployee/" + _empId
                    }
                }
            },
            change: function () {
                employeeList(this.value(), this.text());
            }
        });

        function employeeList(key, val) {
            if (key !== undefined && val !== undefined) {
                alert('key : ' + key);
                alert('val : ' + val);
            }
        }
    });
</script>

ANIL SINGH

Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - http://www.code-sample.com and http://www.code-sample.xyz
My Books - Google Amazon and Flipkart Book Store!

You Might Also Like
Post a Comment
www.code-sample.com/. Powered by Blogger.
ASK Questions
SQL Server NodeJs TypeScript JavaScript Angular SQL Server My Book