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

ClientFooterTemplate + Filtering = bug

1 Answer 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andrew
Top achievements
Rank 1
Andrew asked on 21 Mar 2011, 03:50 PM
Hello,

First of all, thanks a lot for your wonderful MVC extensions. However, there is a minor issue with the grid in latest (Q1 2011) release.

I use mvc grid with ajax binding and grouping enabled, plus there are client group and footer templates defined for certain columns. Yesterday, I have noticed that in my application OnDataBound client event is not fired sometimes.

I investigated further and discovered that it happens when there is a filtering applied with some predicate that evaluates to false for all the rows (so that no rows are displayed).

Tracing showed that the following piece of javascript fails with "object is null of undefined" error:
var p=[];with(data){p.push('Total Count: ', Count ,'');}return p.join('');


So, to workaround this issue, I just changed template function in telerik.grid.js file and added code to check if data variable is not undefined. It worked, but I'm sure that you as developers will suggest something better in next releases.

See attached sample application, if necessary.

Thanks,
Andrew.

1 Answer, 1 is accepted

Sort by
0
Hao
Top achievements
Rank 1
answered on 22 Mar 2011, 08:50 PM
I got the same error and fixed by check data in this js file. It happens when apply ClientFootTemplate.
Tags
Grid
Asked by
Andrew
Top achievements
Rank 1
Answers by
Hao
Top achievements
Rank 1
Share this question
or