[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Cf9 and cfgrid issue

Posted on 2011-10-04
Medium Priority
Last Modified: 2012-05-12
Hello experts.
I have a problem with my cfgrid's.
Since i changed from cf8 to cf9 i get the following error:
Attribute validation error for the CFGRID tag.
height/width attribute cannot be a percentage value.

My Grid:
<cfgrid name="Texttablegrid" format="html" pagesize="30" insert = "Yes"   sort="yes" width="100%"
    rowheaderbold="yes" colHeaderBold = "Yes"    pictureBar="yes" hspace="0" vspace="0"  bind="cfc:cfc.Texttable.getTexttable({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},{filtercolumn},{filter})" selectmode="edit" onchange= "cfc:cfc.Texttable.updateTexttable({cfGridAction},{cfgridrow},{cfgridchanged})">
      <cfgridcolumn name="TABLE_ID" header="Table_id"  select="no" display="false"/>
      <cfgridcolumn name="Text_ID" header="Text ID" type="numeric" numberformat="9" display="false"/>
      <cfgridcolumn name="TEXT" header="Text" />
      <cfgridcolumn name="LangID" header="Language ID" type="numeric"/>

Any help?
Question by:Panos
  • 4
  • 2
LVL 16

Accepted Solution

Gurpreet Singh Randhawa earned 2000 total points
ID: 36911679
you cannot set the width:100% in the cfgrid in coldfusion 9. Yuo can either user autowidth or use a static width in pixels.

2. if you have concerns about the screen resolution, just detect the screen width and deduct domeamount of pixels to create a div of that width and inside that div, create your cfgrid. it works flwlessly


let me know if you need more clarity

Author Comment

ID: 36911748
Hi myselfrandhawa
Can you help me with the second way?
I was thinking to use javascript to get the width of the div where i have placed my cfrid.
Because coldfusion doesn't read js variables i tried to set a cookie and reload the page but i didn't get it work.


Author Comment

ID: 36911829
Some else.
I set width="autowidth"   to get width="100%" but i get an error in firebug:
autowidth is not defined
_cf_GRIDTAG_initAjaxGrid_1317750976159()texttable.cfm (¿¿aµµ¿ 275)
fire()cfajax.js (line 1101)
windowLoadHandler(e=load )cfajax.js (¿¿aµµ¿ 1205)
[¿¿a¿¿p¿ s' a¿t¿ t¿ sf¿¿µa] ColdFusion.Grid.init('Texttablegrid'...','change'],['filter','','change']]);
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.


Author Comment

ID: 36911907
Don't answer my last comment. I change it to autoWidth = "Yes"  .
LVL 16

Assisted Solution

by:Gurpreet Singh Randhawa
Gurpreet Singh Randhawa earned 2000 total points
ID: 36912708
other way will be to pass the width through the url like suppose you are passing some variable in the address bar as:

<a hef="abc.cfm?id=#id#" + "&size=" + screen.width;>bac</a>

so bac page u get size of the window page an dthen based on that just deduct some amount like size-100 to match the screen page size and create a scrolling div and inside the div call the cfgrid tag

all done

Author Closing Comment

ID: 36914262
Thank you for your help.

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
Integration Management Part 2
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question