Skip to main content
February 7, 2008
Answered

context menu in ColdFusion 8 ajax cfgrid

  • February 7, 2008
  • 9 replies
  • 1628 views
I'm not sure if this is because Ext 1 vs Ext 2, but in CF8 which uses Ext,
there's no context menu when right-click on the column header.

However, Ext doc does have a nice contenxt menu, demo:
http://extjs.com/deploy/ext/examples/grid/array-grid.html

Any idea how to enable this for CF8 CFGRID? I already tried going into cfgrid.js
and added "enableColumnHide:true" in var _42 (line 18), but still no luck.

Any help would be appreciated, thank you!
This topic has been closed for replies.
Correct answer
2 NEW EXCELLENT TUTORIALS on context menu for cfgrid!

http://www.danvega.org/blog/index.cfm/2008/3/4/ColdFusion-8-Grid-Context-Menus

http://www.danvega.org/blog/index.cfm/2008/3/4/ColdFusion-8-Grid-Context-Menu-Part-II


p.s. no, we don't need to "modify line 18 by adding enableCtxMenu:true"


However, still can't hide CFGRIDROWINDEX...

9 replies

Correct answer
March 5, 2008
2 NEW EXCELLENT TUTORIALS on context menu for cfgrid!

http://www.danvega.org/blog/index.cfm/2008/3/4/ColdFusion-8-Grid-Context-Menus

http://www.danvega.org/blog/index.cfm/2008/3/4/ColdFusion-8-Grid-Context-Menu-Part-II


p.s. no, we don't need to "modify line 18 by adding enableCtxMenu:true"


However, still can't hide CFGRIDROWINDEX...
Participant
March 6, 2008
I noticed that same problem w/ CFGRIDROW Index. I figured since Ill probably NEVER name a database column by that name, I'd just modify the EXT code to prevent any columns with that name from showing. I went into grid.js and found where it creates the column menu. It basically just grabs the column model and builds the menu. I just surrounded the statements with an if statement to the effect of "if the column name does not equal 'CFGRIDROWINDEX', then add the column to the menu".

I don't have the exact line number off hand as I'm not at work, but if you need help finding it, let me know. The correct file should be located at /CFIDE/scripts/ajax/ext/package/grid/grid.js... Im not 100% on that location tho as again, Im not at work and don't have the files handy...

Inspiring
July 17, 2013

I am using CF9 and would like to use Ajax to build grid context menu,

I could not find the js file you mention, can you please advice where I can download the js file the link mentioned.

Your help and information is great appreciated,

Regards,

Iccsi,

Participant
March 4, 2008
I figured it out!!!

Inside of cfgrid.js, modify line 18 by adding "enableCtxMenu:true", then include a script reference in the header of your page to "/CFIDE/scripts/ajax/ext/package/menu/menus.js"

Send me a private message if you have any trouble with it!
March 4, 2008
NICE! thank you!!!

now I need to figure out how to really hide columns that I want to hide, (e.g. CFGRIDROWINDEX, and maybe the real id of the table in the DB)

Henry
March 4, 2008
OK, after some investigation, there's no way to hide CFGRIDROWINDEX unless you comment out the last element in the _cf_gridColModel array in the <head> inserted by <cfgrid> calling <cfhtmlhead>... which is:
{header:'CFGRIDROWINDEX'.....

TOO BAD! If <cfsavecontent> can save the code inserted by the <cfhtmlhead>, then we can parse the string and remove the last element.. but that's not the case unfortunately...
markireland
Known Participant
February 22, 2008
Check out Dan Vegas cfExt project at riaforge.com
Participant
February 22, 2008
I've checked that out before and its great for creating new Ext objects (although a license would still be needed in production use)... it doesnt answer the issue w/ the contextmenu not showing up with using a cfgrid.

I did some tests and subscribed to the headercontextmenu events and it is in fact firing, the menu it self tho us not appearing, and instead the Internet Explorer menu is appearing... (or firefox)...

Participant
February 21, 2008
I'm having the same trouble as well... I've tried modifying the properties of the grid to no avail...

Anyone?

Thanks,
-Jared