Tuesday, December 27, 2005

Using Ajax Techniques @ Work

I wouldn't say I condem Ajax. I'd say that I am just skeptical of new "buzz" like technologies and while I have seen the effective use of it via Gmail and various other sites popping up here and there, I never really thought I'd find a good use for it.

On a project I am working on we needed to sort a table of data by clicking on the column headers. A very common task that has been done many many times. The problem though was that since we are pulling all the rows from the database and paging through the results using Javascript there are just too many rows for javascript to handle without choking. Also, because of the way things are done here, it's not an easy process to persist page data to be redisplayed if we were to submit the entire page just to sort a column using SQL.

I suggested using Ajax techniques and it seems to be working out very well for us so far. Clicking on the column headers makes an ajax request to the server for the data already sorted. I then take that data (xml) and rebuild my array in javascript. Turned out to be really simple.

I wouldn't say I condone the use of Ajax...

No comments: