tags:

views:

74

answers:

1

I want a "Check all" check box in a grid to let the data get updated in DB thru ajax.. but due to restriction of 2 calls at a time I am not able to make it happen. Help me to resolve the issue.

+1  A: 

Your question is a little vague, but I suppose you are sending one Ajax request for each checkbox that's being checked, when the user clicks the "check all" button ?

If so, you should modify your code, so only one Ajax request is sent ; it should say the server "oh oh, all checkboxes have been checked, do your stuff", instead of just saying "one checkbox has been checked".


This way, no matter what the user does, you only have one Ajax request, which means :

  • Faster
  • No (well, less) problem with concurrency
  • No problem of too many Ajax requests in parallel
  • No risk of one request not making it to the server
  • Less load on the server (and the client)

(But, yes, I admit, it means modifying your code a little bit ;-) )

Pascal MARTIN