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

Turning off Selectable

1 Answer 77 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Paulie
Top achievements
Rank 1
Paulie asked on 20 Aug 2012, 09:15 PM
I coded to call a ListView and I want to have it where I can either set the selectable attribute off or on depending on how I am using the view at the time.  I find that once I call the KendoListView with selectable: true, it never turns off, even if I reload with the isSelectable set to false).  Is there something I need to do to clear the previous setting?  

Here is a sample of the code:

        $("#content").empty();
        $("#content").append(template);


        if (isSelectable) {
            $("#content").kendoListView({
                dataSource: dataSource,
                template: kendo.template($("#template").html()),
                selectable: true,
                change: function (e) {
                    alert("selected change event");
                }
            });
        }
        else {
            $("#content").kendoListView({
                dataSource: dataSource,
                template: kendo.template($("#template").html()),
                selectable: false
            });
        }

1 Answer, 1 is accepted

Sort by
0
Paulie
Top achievements
Rank 1
answered on 21 Aug 2012, 04:03 PM
Never mind, I think I already fixed my problem  I'm now creating a new div in the javascript and adding the List View to the new div, instead of adding it the an existing div on the html.  Now each time I load a new listview, it does not retain the properties of the previous listview.  

 $("#content").empty();
var list = '<div id="content_list"></div>';
("#content").append($(list));

$("#content_list").kendoListView({
          dataSource: dataSource,
          template: kendo.template($("#template").html()),
 });
Tags
ListView
Asked by
Paulie
Top achievements
Rank 1
Answers by
Paulie
Top achievements
Rank 1
Share this question
or