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

template dropdown problem to display and bind to a grid

1 Answer 151 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Colin
Top achievements
Rank 1
Colin asked on 08 Dec 2011, 04:14 PM
 It is weird, I need tech support to have this check, wondering if anything wrong inside the below script to make code fail to display.

debug error: Uncaught TypeError: Object [object Object] has no method 'prop'

Thanks

<div id="grid"></div>
    
<script type="text/x-kendo-template" id="template">
       <input type="search" id="category"></input>
</script>

<script>
$(document).ready(function () {
    var grid = $('#grid').kendoGrid({
        dataSource: datasource,
        toolbar: kendo.template($("#template").html()),
    });

    var dropDown = grid.find("#category").kendoDropDownList({
        dataTextField: "CategoryName",
        dataValueField: "CategoryID",
        autoBind: false,
        optionLabel: "All",
        dataSource: categoryDataSource,
        change: function () {
            var value = this.value();
            if (value) {
                grid.data("kendoGrid").dataSource.filter({ field: "CategoryID", operator: "eq", value: parseInt(value) });
            } else {
                grid.data("kendoGrid").dataSource.filter({});
            }
        }
    });
</script>

1 Answer, 1 is accepted

Sort by
0
Colin
Top achievements
Rank 1
answered on 08 Dec 2011, 07:33 PM
Alright, the script itself is no problem at all. problem is the jQuery version, as soon as replacing v.1.5.x which is default add to MVC project  with v.1.6.x, problem with weird error message gone.

hope this could save some of your dev time.
Tags
Grid
Asked by
Colin
Top achievements
Rank 1
Answers by
Colin
Top achievements
Rank 1
Share this question
or