Cf9 and cfgrid issue

Posted on 2011-10-04
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
    LVL 15

    Accepted Solution

    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
    LVL 2

    Author Comment

    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.

    LVL 2

    Author Comment

    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']]);
    LVL 2

    Author Comment

    Don't answer my last comment. I change it to autoWidth = "Yes"  .
    LVL 15

    Assisted Solution

    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
    LVL 2

    Author Closing Comment

    Thank you for your help.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
    I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    728 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now