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

KendoUI Grid filter redirecting to another page

3 Answers 278 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Igor Diamant
Top achievements
Rank 1
Igor Diamant asked on 11 Dec 2012, 11:05 AM

Something very strange is happening when I am using the filter of KendoUI Grid. My grid is very simple and the definition is like this:

var cols = [];

        cols[0] = { field: 'name', title: 'Nome', width: "65%" };
        cols[1] = { field: 'eMail', title: 'eMail', width: "20%" };
        cols[2] = { field: 'city', title: 'Cidade', width: "15%" };

        var cfgGrid = { dataSource: dsPersons,
                        batch: false,
                        change: onSelectedRow,
                        selectable: "row",
                        resizable: true,
                        scrollable: true,
                        sortable: { mode: 'multiple', allowUnsort: true },
                        filterable: true,
                        editable: false,
                        pageable: { numeric: false },
                        columns: cols };

        gridPessoas = null;
        gridPessoas = $("#gridElem").kendoGrid(cfgGrid).data("kendoGrid");

The grid is displayed correctly in url:

http://localhost:50409/#/personsView

But when I try to filter any column kendoUI redirects to a page:
http://localhost:50409/undefined?

The Datasource was defined like that:
var ds = { data: persons,
           schema: model,
           filter: {},
           serverPaging: false,
           serverFiltering: false,
           pageSize: 12 };

The grid is ok and the error only occurs when I define a filter value and click on the filter button.

This is an ASP.NET MVC 4 site. I cannot imagine what is going on.

Can you help me ???

Thanks in advance

3 Answers, 1 is accepted

Sort by
0
Igor Diamant
Top achievements
Rank 1
answered on 12 Dec 2012, 11:16 AM

I have discovered the problem.

I am working with Sammy that is a javascript framework that allows us to define routes and each time a new location is defined Sammy set window.location to the new location.

I have just started to work with Sammy so I cannot give you more details. But when I select a  KendoUI filter the "setLocation" Method of Sammy is called with a new location equal to "undefined?".

As you can see all my interaction with Kendo controls is local. My application loads all the JSON, creates the datasource and binds to the grid. So I cannot understand why is Kendo Grid redirecting to an URL. I am setting explicitily the serverFiltering to false. 

I do not know why is KendoUI causing this kind of behaviour but this is the real problem. I have just bought KendoUI and I would like to know how to proceed.

If someone from Telerik is reading please give me a workaround so that I can use the native Kendo filter in my application. By now I will try to block this url in Sammy, but, as I told you, I am new to Sammy and I must ask the Sammy development people how can I do it.

Thanks

0
Nikolay Rusev
Telerik team
answered on 13 Dec 2012, 09:29 AM
Hello Igor,

We are not aware of what exactly Sammyjs may break in our Grid widget. One thing that comes into my mind is that it can wire some handlers(click/mousedown) before Kendo Grid. This can possible cause Sammyjs scripts to execute their default actions and prevent Grid actions to execute.

That said you should definitely see what there docs/support is for such scenarios. 

Regards,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Igor Diamant
Top achievements
Rank 1
answered on 13 Dec 2012, 11:36 AM
Hi Nikolay,

For now I have blocked the /undefined? route, it is working now. I will check with Sammy people what can be done.

Thanks for you answer
Tags
Grid
Asked by
Igor Diamant
Top achievements
Rank 1
Answers by
Igor Diamant
Top achievements
Rank 1
Nikolay Rusev
Telerik team
Share this question
or