Re: jquery grid problem

2009-08-13 Thread Dominic Watson

Yes absolutely right - dang useful that. The other thing to be weary of is
cf debugging output - so:

cfsetting showdebugoutput=false /cfcontent reset=true
type=application/json /(output code)

I think this is especially helpful when there are other devs working on the
same project.

Dominic


 Ah, see, my application.cfm outputs some html comments that sometimes
 screws up calls like this so I've become used to doing a cfcontent
 reset to blank out anything in the output buffer.

 Thanks!

 Rick

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325430
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: jquery grid problem

2009-08-13 Thread Rick Root

On Thu, Aug 13, 2009 at 4:31 AM, Dominic
Watsonwatson.domi...@googlemail.com wrote:

 Yes absolutely right - dang useful that. The other thing to be weary of is
 cf debugging output - so:

 cfsetting showdebugoutput=false /cfcontent reset=true
 type=application/json /(output code)

 I think this is especially helpful when there are other devs working on the
 same project.

Not a problem if you're using Firebug and Coldfire =)

Rick

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325431
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: jquery grid problem

2009-08-13 Thread Dominic Watson

And working alone indeed

2009/8/13 Rick Root rick.r...@webworksllc.com

 Not a problem if you're using Firebug and Coldfire =)



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325432
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


jquery grid problem

2009-08-12 Thread Rick Root

So I'm trying to use a grid component - either jqGrid of flexigrid.
Both seem very nice.

But both expect the JSON data to be returned in a specific format..

Example... flexigrid is looking for an object containing page
total and rows where rows is an array.

So my cfc does this:

cfset LOCAL.retVal = structNew()
cfset LOCAL.retVal.page = 1
cfset LOCAL.retVal.total = LOCAL.qry.recordCount 
cfset LOCAL.retVal.rows = 
application.udf.QueryToArrayOfStructures(LOCAL.qry)
cfcontent type=text/plain reset=yes
cfreturn LOCAL.retVal /

and the problem here is that coldfusion upper cases the structure
elements, so I end up with PAGE TOTAL and ROWS which of course
it doesn't like because JS is case sensitive.

What do I do?


-- 
Rick Root
New Brian Vander Ark Album, songs in the music player and cool behind
the scenes video at www.myspace.com/brianvanderark

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325413
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: jquery grid problem

2009-08-12 Thread Dominic Watson

You can use array notation for your structure keys here. So:

cfset LOCAL.retVal.page = 1

Becomes:

cfset LOCAL.retVal['page'] = 1 

Using array notation in this only way AFAIK to force the case of your keys
(CF will uppercase them otherwise).

Dominic

2009/8/12 Rick Root rick.r...@webworksllc.com


 So I'm trying to use a grid component - either jqGrid of flexigrid.
 Both seem very nice.

 But both expect the JSON data to be returned in a specific format..

 Example... flexigrid is looking for an object containing page
 total and rows where rows is an array.

 So my cfc does this:

cfset LOCAL.retVal = structNew()
cfset LOCAL.retVal.page = 1
cfset LOCAL.retVal.total = LOCAL.qry.recordCount 
cfset LOCAL.retVal.rows =
 application.udf.QueryToArrayOfStructures(LOCAL.qry)
cfcontent type=text/plain reset=yes
cfreturn LOCAL.retVal /

 and the problem here is that coldfusion upper cases the structure
 elements, so I end up with PAGE TOTAL and ROWS which of course
 it doesn't like because JS is case sensitive.

 What do I do?


 --
 Rick Root
 New Brian Vander Ark Album, songs in the music player and cool behind
 the scenes video at www.myspace.com/brianvanderark

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325416
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: jquery grid problem

2009-08-12 Thread Dominic Watson

Also, and this is kind of redundant, there is a mime type for json:
application/json. So, if you're feeling particularly anal, you can do:

cfcontent type=application/json reset=yes...

Dominic

2009/8/12 Dominic Watson watson.domi...@googlemail.com

 You can use array notation for your structure keys here. So:

 cfset LOCAL.retVal.page = 1

 Becomes:

 cfset LOCAL.retVal['page'] = 1 

 Using array notation in this only way AFAIK to force the case of your keys
 (CF will uppercase them otherwise).

 Dominic



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325417
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: jquery grid problem

2009-08-12 Thread Rick Root

On Wed, Aug 12, 2009 at 5:07 PM, Dominic
Watsonwatson.domi...@googlemail.com wrote:

 Also, and this is kind of redundant, there is a mime type for json:
 application/json. So, if you're feeling particularly anal, you can do:

 cfcontent type=application/json reset=yes...

Ah, see, my application.cfm outputs some html comments that sometimes
screws up calls like this so I've become used to doing a cfcontent
reset to blank out anything in the output buffer.

Thanks!

Rick

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325426
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4