Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to restrict kendo multiselect to single selection #246

Open
MaheshShetty123 opened this issue May 1, 2017 · 1 comment
Open

How to restrict kendo multiselect to single selection #246

MaheshShetty123 opened this issue May 1, 2017 · 1 comment

Comments

@MaheshShetty123
Copy link

MaheshShetty123 commented May 1, 2017

Hi,
I have implemented kendo knockout multiselect to my project. But I can't able to figure out how to restrict the selection option.

below is my recent knockout kendo code

my earlier kendo code looks like this

    $("#" + id).kendoMultiSelect({
        placeholder: "Select Time Periods ...",
        dataTextField: "TpDescription",
        dataValueField: "TpTimeperiodId",
        autoBind: true,           
        change: function (e) {
            var id = this.element.attr("id");
            competititveAnalysisViewModel.findGraphItem(id);
        },
        open: function (e) {
            if (this.value().length == 1)
                e.preventDefault();   // here i m restricting the selection. How to acheive by using knockout                                                      
        },
        dataSource: trailingTimePeriods
    });     

How to achive by using knockout kendo . Please help me out

Thanks,
Mahesh

@irega
Copy link
Contributor

irega commented Jun 26, 2017

Hi,
@MaheshShetty123 your code is valid for "knockout-kendo" too. I have done this fiddle for you:
https://jsfiddle.net/ireinoso/k24ww6dh/7/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants