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

[Solved] IE vs Firefox - Back button behavior

2 Answers 86 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.
Helene Dumas
Top achievements
Rank 1
Helene Dumas asked on 23 Nov 2010, 05:34 PM
Hello,
I am using a MVC grid with Ajax binding.  The grid presents a list of brochure titles.  The grid is filterable.  When the user clicks on one of the titles, it presents a new page with the details of the brochure.
When using IE as a browser, when the user is viewing the details of a brochure and clicks on the back button, the GridAction in the Controller is fired and the grid is refreshed with the default values, BUT, when in Firefox, the Grid Action is never fired and the page appears as it was, with the grid in the same state as before... the filters are still there and the result of the page is still the same.
Can someone tell me how I can bypass the GridAction when using the back button in Internet Explorer.
Thank you.

2 Answers, 1 is accepted

Sort by
0
Bob
Top achievements
Rank 1
answered on 24 Nov 2010, 12:20 AM
I would like to see the grid definition, especially the title. Is it an ActionLink, a button, or something else? I ask, because if it you have code attached to the title that does a redirect, IE and FF differ in how the back button works after the redirect - depending upon the type of redirect that you do: ActionLink, href=url, window.location=url, or window.location.replace(url) may have different results in different browsers. I have found that window.location=url is most consistent between IE and FF.
0
Helene Dumas
Top achievements
Rank 1
answered on 24 Nov 2010, 02:25 PM
Thanks for taking a look... I am using the window.location = URL.
I am sending you my grid definition and the code is on the "onRowSelected" which brings the user to the details of a brochure... that's when using the back button to come back to the list, IE fires the gridAction, but FF does not.  Of course I prefer FF's way of doing it and would like to know what I have to do so that IE does not fire the gridAction.  I am using IE7, but someone with IE8 tells me that it is doing the same thing.

 

 

<div class="span-24 last">

 

<% Html.Telerik().Grid<MTO.GIPI.Web.Controllers.Publications.ViewModels.

 

PublicationListViewModel>()

 

.Name(

 

"grdPublications")

 

.DataKeys(keys => keys.Add(c => c.PublicationId))

.Columns(column =>

{

column.Bound(a => a.DateInactif).Title(

 

"").Width(50).Filterable(false);

 

column.Bound(a => a.Code).Title(

 

"Code").Width(60).Filterable(true);

 

column.Bound(a => a.Titre).Title(

 

"Titre").Filterable(true);

 

column.Bound(a => a.Description).Title(

 

"Description").Width(160).Filterable(false);

 

column.Bound(a => a.DateActif).Title(

 

"Date actif").Width(90).Filterable(false);

 

column.Bound(a => a.MoisDebutPeriode).Title(

 

"Saison").Width(80).Filterable(false);

 

column.Bound(a => a.NomTypePublication).Title(

 

"Type").Width(100).Filterable(false);

 

column.Bound(a => a.Poids).Title(

 

"Poids(g)").Width(75).Filterable(false);

 

column.Bound(a => a.ListeLangues).Title(

 

"Langues").Width(125).Filterable(false);

 

})

.DataBinding(bind => bind.Ajax().Select(

 

"PublicationGridData", "Publications"))

 

.Selectable()

.Sortable()

.Filterable()

.Pageable(page => page.PageSize(10))

.Scrollable(scroll => scroll.Height(250))

.ClientEvents(events =>

{

events.OnRowSelected(

 

"onRowSelected");

 

events.OnLoad(

 

"onLoad");

 

})

.Render();

%>

 

 

</div>

 


 

 

function onRowSelected(e) {

 

 

 

var grid = $(e.target).data('tGrid');

 

 

 

var rowIndex = $(e.row).parent().find('tr:not(.t-grouping-row)').index(e.row);

 

 

 

var publication = grid.data[rowIndex];

 

window.location =

 

"/Publications/Details/" + publication.PublicationId;

 

}

Tags
Grid
Asked by
Helene Dumas
Top achievements
Rank 1
Answers by
Bob
Top achievements
Rank 1
Helene Dumas
Top achievements
Rank 1
Share this question
or