Posts Tagged ‘cfgrid’

CFGrid Performance

June 17, 2010 Leave a comment

Since implementing CFGrid in a few applications at work, I’ve noticed a real drop in performance.  This is particularly evident in an application that, when deployed will perform a lot of queries and present a lot of tabular data in datagrids.  Just in development with maybe 200 records, I am noticing 3-5 second page loads for data retrieval.  I’m sure it has to do with a lot of the query manipulation that happens in preparation for display in the grid, which I mentioned in an earlier post.  I think I need to come up with a way to code one grid generating CFC which can be called by the data retrieval CFCs.  When I first began development on this application, we did not use stored procedures.  I think that will need to happen and change my CFCs to use the CFSTOREDPROC tag.  Not sure yet how this is going to affect my timeline, but this application is going to be used by nearly every one of the ~2000 employees here, many of whom are in countries that may not have access to high bandwidth connections, so performance is going to be critical.  I’ve heard a lot about jQuery solutions such as jqGrid, but it doesn’t seem to fit this particular case.  I haven’t seen where arguments for data retrieval can be passed into jqGrid.  Perhaps I am wrong, but no example I’ve seen involves a CFC that takes arguments and produces a datagrid.

I’d love to hear thoughts and ideas on improving performance with ColdFusion’s ajax capabilities.


CFGrid Problem Solved!

August 14, 2009 1 comment

In my previous post My Adventure with CFGrid, I wrote about troubles I was having meeting some minor last minute client requirements.  In short, they want a cool table with Ajax features like paging, but they also want links in the table in an Actions column that are not Ajax and take the user to a detail page.  Sounds like an odd request for Ajax functionality but what the client wants the client gets.

My initial problem was how to add the links to the Actions column.  This was solved with the help of Ray Camden who suggested using the querySetCell() method to add my link data to the query recordset after the query is executed.  This worked well enough and my manager was impressed.  Something I didn’t pay attention to initially was that the pagesize attribute of cfgrid is ignored when the query attribute is specified.  The client definitely wants paging for larger recordsets, so the solution turned out to be using the bind parameter rather than the query attribute.

Having never used databinding before, I jumped right in and quickly found all sorts of little things that normally work, suddenly didn’t.  None of my APPLICATION or SESSION variables seemed to be available.  Variable not defined was what the error read.  By the way, I highly recommend Firebug for debugging Ajax requests.  The solution was to either hardcode my variables or add hidden form elements and then pass them in my bind parameter to the CFC.  I ended up using both to finally get my awesome looking cfgrid that pages through 10 records at a time and has an Actions column which takes the user to a detail page.

CFGrid goodness

While at CFUnited this I decided to ask around about why my SESSION and APPLICATION variables were coming up undefined when called via the bind parameter.  It was explained to me that bind is accessing the CFC directly rather than as a normal ColdFusion request and that is why they were not available.  This sounds reasonable to me, but I would like to get some confirmation.  So I pose the question to all my fellow CFers out there.  Is this really the case with databinding?