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

How to populate the total number of records using jQuery

2 Answers 65 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.
Andre' Hazelwood
Top achievements
Rank 1
Andre' Hazelwood asked on 23 Mar 2011, 04:42 PM
I am calling a custom web service (because I need to pass some additional data), and get data back successfully through the Client OnDataBinding event.  I can't seem to find any documentation anywhere about all of the functions I can utilize within jQuery to set things like the current page Index, the total number of records, etc.  Any pointers to where this can be located at?  The help located at:  http://www.telerik.com/help/aspnet-mvc/telerik-ui-components-grid-client-api-and-events.html  doesn't go into enough detail about how to set some of these properties.

Thanks.

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 23 Mar 2011, 05:12 PM
Hello Andre' Hazelwood,

 You can try setting the currentPage and total fields of the grid. However I am not sure what the required behavior is. Could you clarify what you expect to happen after setting the current page or total fields? The pager won't update by doing just that.

Regards,
Atanas Korchev
the Telerik team
0
Andre' Hazelwood
Top achievements
Rank 1
answered on 23 Mar 2011, 05:56 PM
I actually figured it out by setting the grid.total value to the number of records coming back.

            $.post('/services/MyService.asmx/GetData', SerializeSearchRequest(grid),
            function (data) {
                grid.total = data.RecordCount;
                grid.dataBind(data.Records);
            });

It would be nice to have more clarity on all javascript functions/properties that are available on all of the MVC controls, similar to how the help documentation is for the AJAX Controls (see the complete Client-side Programming section on the left by going to http://www.telerik.com/help/aspnet-ajax/grid-getting-client-object.html).  Documentation like this would be of extreme value.
Tags
Grid
Asked by
Andre' Hazelwood
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Andre' Hazelwood
Top achievements
Rank 1
Share this question
or