This question is locked. New answers and comments are not allowed.
Andy McShane
Top achievements
Rank 1
Andy McShane
asked on 12 Mar 2010, 03:29 PM
Ji, I have a grid on my page configured as follows;
This loads fine but clicking on the refresh icon in the footer does not do anything, I can see no post back for refreshing the grid. This must be something to do with placement and configuration as I have another grid on another page setup in the same way that does work but for the life of me I cannot see what the problem is. Do I have to have the grid inside of an ajax form or something?
| <%= Html.Telerik().Grid(Model.SupportContacts) |
| .Name("Contacts") |
| .Columns(columns => |
| { |
| columns.Add(o => o.MilestoneShortname).Title("Milestone"); |
| columns.Add(o => o.CommunicationMethodShortname).Title("Communication Method"); |
| }) |
| .Ajax(ajax => ajax.Action("Filtering", "SupportSchema", new { id = Model.SupportSchemaDetails.SupportSchemaId })) |
| %> |
This loads fine but clicking on the refresh icon in the footer does not do anything, I can see no post back for refreshing the grid. This must be something to do with placement and configuration as I have another grid on another page setup in the same way that does work but for the life of me I cannot see what the problem is. Do I have to have the grid inside of an ajax form or something?
13 Answers, 1 is accepted
0
Hello Andy McShane,
The refresh button never makes a postback in ajax binding scenarios. It just makes ajax request based on the current grid state - sorting, paging etc. There is no need to put the grid in any ajax forms. You can check the "First look" grid demo - the refresh button behaves as expected there. Also take into account that the loading icon will not show if the ajax request completes quickly.
Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
The refresh button never makes a postback in ajax binding scenarios. It just makes ajax request based on the current grid state - sorting, paging etc. There is no need to put the grid in any ajax forms. You can check the "First look" grid demo - the refresh button behaves as expected there. Also take into account that the loading icon will not show if the ajax request completes quickly.
Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Andy McShane
Top achievements
Rank 1
answered on 12 Mar 2010, 04:01 PM
Do I have to apply any other settings then? As the grid that I have attached here does not even execute my Ajax call (when viewed with Firebug), clicking on refresh simply does nothing. Do I have enable sorting, pageing, etc?
0
Hi Andy McShane,
No, there is no other thing required. Can you confirm you have a ScriptRegistrar and all JavaScript files are loaded? Also JavaScript errors can prohibit the refresh button (and any other grid client-side features) from working.
Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
No, there is no other thing required. Can you confirm you have a ScriptRegistrar and all JavaScript files are loaded? Also JavaScript errors can prohibit the refresh button (and any other grid client-side features) from working.
Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Andy McShane
Top achievements
Rank 1
answered on 12 Mar 2010, 04:12 PM
Yes, according to firebug all javascripts are loaded, there is no indication of any javascript errors. Clicking on a header column to sort does generate a 'GET', even though it executes the wrong action, just nothing happens when clicking the refresh. When I am in Firebug and click refresh it just appears to make the page jump but never gets to my breakpoint in my controller. Very bizarre?
Bit more info, using the developer tools in IE I have managed to find the following line of script
<script type="text/javascript">jQuery('#Contacts').tGrid({columns:[{"name":"MilestoneShortname","type":"String"},{"name":"CommunicationMethodShortname","type":"String"}], pageSize:0, ajaxUrl:'/PPMSII/SupportSchema/_AjaxBinding/19'});</script>
This clearly shows the correct Url for my Ajax call however clicking on it simply does nothing!
Bit more info, using the developer tools in IE I have managed to find the following line of script
<script type="text/javascript">jQuery('#Contacts').tGrid({columns:[{"name":"MilestoneShortname","type":"String"},{"name":"CommunicationMethodShortname","type":"String"}], pageSize:0, ajaxUrl:'/PPMSII/SupportSchema/_AjaxBinding/19'});</script>
This clearly shows the correct Url for my Ajax call however clicking on it simply does nothing!
0
Hello Andy McShane,
I cannot provide further help unless I somehow reproduce the problem. Is there any live url where this can be observed? Alternatively you can consider uploading a sample somewhere so I can test it.
Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
I cannot provide further help unless I somehow reproduce the problem. Is there any live url where this can be observed? Alternatively you can consider uploading a sample somewhere so I can test it.
Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Andy McShane
Top achievements
Rank 1
answered on 12 Mar 2010, 04:37 PM
Thanks for your help, I will have to try to put something together over the weekend and get an example to you.
0
Andy McShane
Top achievements
Rank 1
answered on 15 Mar 2010, 05:16 PM
Ok, I have created a test enviroment where you can view this behaviour and try to see what I have done wrong. This is only a temporary link and will only be available for approx 24 hours.
http://mvc.asmwp.co.uk/
username: andy.mcshane
password: password
Once logged in click on 'Customer Administration',
Select 'Edit' for 'Customer ID' 7,
Select 'Support Schema' tab,
Select an option from the drop-down list,
On the grid that is shown, try clicking the refresh icon and you will see that it does nothing.
If you then select the 'Licence Details' tab you will see that the refresh on the grid that is displayed there does work as expected.
Hope this helps?
http://mvc.asmwp.co.uk/
username: andy.mcshane
password: password
Once logged in click on 'Customer Administration',
Select 'Edit' for 'Customer ID' 7,
Select 'Support Schema' tab,
Select an option from the drop-down list,
On the grid that is shown, try clicking the refresh icon and you will see that it does nothing.
If you then select the 'Licence Details' tab you will see that the refresh on the grid that is displayed there does work as expected.
Hope this helps?
0
Hello Andy McShane,
This problem is due the fact that the built-in ajax (Ajax.Form, Ajax.LinkButton) does not execute JavaScript after updating the target element. As a result the grid is not initialized hence the refresh button does nothing. Please check the "Using with partial views loaded via Ajax" help topic for instructions how deal with this problem.
Kind regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
This problem is due the fact that the built-in ajax (Ajax.Form, Ajax.LinkButton) does not execute JavaScript after updating the target element. As a result the grid is not initialized hence the refresh button does nothing. Please check the "Using with partial views loaded via Ajax" help topic for instructions how deal with this problem.
Kind regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Andy McShane
Top achievements
Rank 1
answered on 15 Mar 2010, 06:08 PM
The link you have given returns a 404! :-(
0
Accepted
Hi Andy McShane,
Here is the correct url.
Kind regards,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Here is the correct url.
Kind regards,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Andy McShane
Top achievements
Rank 1
answered on 16 Mar 2010, 11:44 AM
Excellent, thank you very much, that little problem is now solved.
0
Rogerio
Top achievements
Rank 2
answered on 07 May 2012, 12:27 PM
The link don't work!
Thanks.
Thanks.
0
Hi,
Atanas Korchev
the Telerik team
Here is the updated link: http://www.telerik.com/help/aspnet-mvc/using-with-partial-views-loaded-via-ajax.html
Greetings,Atanas Korchev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.