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

Add new button crashes after grid is filtered

1 Answer 19 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Travis
Top achievements
Rank 1
Travis asked on 22 Aug 2012, 09:09 PM

I'm filtering my grid with the following code:

$("#grid").data("kendoGrid").dataSource.filter({ logic: "or", filters: [{ field: "MyField", operator: "equals", value: parseInt($("#MyDropDown").val())}] });

This will filter the grid fine, but then when I click the "Add new record" button in the grid toolbar, nothing happens.  Editing and deleting still function, but create/add new does not.

1 Answer, 1 is accepted

Sort by
0
Travis
Top achievements
Rank 1
answered on 22 Aug 2012, 10:44 PM
I've found a work around for now.  Instead of setting the data source filters after the grid is created, I'm setting a function for the "read" method which checks my dropdown value:

 

transport: {
                    read: {
                        url: function () {
                            return apiUrl + "MyWebApiMethod?MyParam=" + $("#MyDropDown").val()
                        },
                        type: 'GET'
                    },
Tags
Grid
Asked by
Travis
Top achievements
Rank 1
Answers by
Travis
Top achievements
Rank 1
Share this question
or