1

I am working on a web application.

I have a data grid with a 'commands' column that has hyperlinks for some common CRUD operations (Edit, Delete, etc).

When a user clicks on say the Edit hyperlink, I retrieve the unique identifier for the data grid row and load a modal form dialog (i am using jQuery UI) so the user is able to edit the row data and subsequently close the modal form dialog at which point I refresh the page.

Now, before the page is done refreshing, there's a chance that a user might click on the edit link again, and whenever that happens, 'hijaxing' fails.

My question is how can i check that if a user clicks on a hyperlink and the page is refreshing, i delay until it is done refreshing, then i allow the 'hijax' to kick in.

Izmoto
  • 1,939
  • 2
  • 17
  • 21
  • @Kevin Reid thank you for your input. I got it to work by rendering the content from a partial view (i am using the asp.net mvc framework) - so after i am done updating a record for example, i just retrieve the html of the partial view via ajax and do a replace of the 'old' container (div). New problem > when editing an image, the logic works fine but how do i get the browser to refresh the image container (div) so that the newly uploaded image is shown in place of the old one? (i do not want to refresh the whole page). – Izmoto Jun 02 '10 at 09:00
  • 1
    That ought to be posted as a separate question. But anyway, there's no way to direct the browser to reload; the usual strategy is to make the URL different. You don't have to do anything on the server-side, just change the URL; e.g. from `/images/image1?time=444213` to `/image/image1?time=443145`, just using the current timestamp, time uploaded, or a version number. – Kevin Reid Jun 02 '10 at 14:03
  • thanks Kevin, really cool idea (about making the URL different), i will explore this option :-) – Izmoto Jun 02 '10 at 14:40

1 Answers1

0

How about not closing the dialog, but letting the page refresh discard it?

Kevin Reid
  • 37,492
  • 13
  • 80
  • 108