I still consider myself a beginner when it comes to JQUERY+Coldfusion…so I’d like to ask for help/ direction on this.
I’m trying to make a search page of items that acts similar to gmail. There is a delete button and basically it asynchronously deletes an item from the database and should update the page asynchronously (removing said item from list). I’ve gotten kind of close as to figuring out how to do this. However, now I’m rethinking how I should go about this.
Currently, my code updates the database and then re-runs the query from a CFC. I’m starting to wonder if I should not do this. Would it be easier to convert the query to a JSON format and have jquery/javascript remove things from the what the client sees and then also run a deletion query?
If JSON seems to be the answer can someone point me to a good place to learn how to manipulate JSON? I’ve looked at a few examples and most of it looks like built in json parsing functions, then the rest is just getting it in the format you need/want.
The way we handle this is simple:
So esentially you are keeping the UI and the database in sync. This is an efficient way as it ensures you are only running essential queries against the database (e.g. delete v delete / read all again). It is also snappier for the user.
Hope that helps!