python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
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

Hi there! Welcome to my blog. My name is Anil Singh. I'm a author of this blog. For more detail about me, kindly refer to this link..
My Blogs - http://code-sample.com and http://code-sample.xyz
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like
www.code-sample.com/. Powered by Blogger.
ASK Questions