Reputation: 205
I have a table/grid system with seven days along the top and the various types of data down the side. For each type of data against a particular day, there's a plus and minus sign so the user can increase or decrease the data occurrences. Given that there are plenty of data types as well as seven (for each day) values for each type, what's the best way to do it?
I'm dubious about Ajax as each plus and minus click would call a database operation, but the only other alternative (please correct me if I'm wrong) is that I dynamically update the values of a form and then force the user to "submit" once they've submitted all the information they need - but isn't this a lot of form values to process?
Upvotes: 0
Views: 154
Reputation: 5313
To send a form, it's better you use jQuery form plugins.
For a best practice advice:
Upvotes: 0
Reputation: 26835
You could possibly use Ajax once the user leaves the page.
$(window).unload(function() {
// Create json object
var json = {...}
$.post('/reciever.php', json);
});
But I would suggest that you update in realtime even though it means a bunch of db-calls. It shouldn't be to expensive.
Upvotes: 1