James Owers

Archive for the ‘asp tutorials’ Category

Flexigrid with asp (version 2)

Friday, April 25th, 2008

After some users reported problems using my flexigrid with asp and IE I decided to redo some of the code to fix it.

Basically the problem was that when the JSON code generated it is supposed to add a comma (,) to the end of every line apart from the last one. My code put a comma at the end of every line including the last one. Firefox realises this and fixes the problem while IE just dies and wont show the content. All I did was added a quick if statement to the end of the line that checks to see if it’s the last record retrieved from the database or not and sticks the comma on the end if it has to.

I’ve also been working with flexigrid at work as part of an application I’m making which populates the flexigrid with data users have entered using online forms and PDAs. This presented the problem that people dont always enter alpha numeric characters and flexigrid doesn’t seem to like this so I added a function called cleanup that will remove all non alpha numeric characters from your data before it kills flexigrid. This is also included in the new distro. And as a side note, I have had flexigrid working with 3500 records from a Sybase database a work without any problems.

Again, thanks to Paulo for creating flexigrid in the first place! And you can download the new distro of my asp backend here or see the demo here.

Flexigrid with asp

Monday, April 7th, 2008

***This version is an outdated version of my script which has some display errors with IE. Please take a look at asp with flexigrid V2.***

I came across a pretty nifty script called Flexigrid. Basically it allows you to take information from a database using JSON or XML and display it on a pretty nifty grid with search, pagination, sorting and some other cool features.

Anyway, all of the examples use PHP to generate the XML or JSON so I decided to do it in ASP using a microsoft access database. You can view a demo of what I made here and download all the files (including the test db) here.

You can also visit the flexigrid website here.