CFGRID row highlight programtically

Ask a Question related to Coldfusion Flash Integration, Design and Development.

  1. #1

    Default CFGRID row highlight programtically

    Can you programatically set a row to be highlighted in a CFGRID? I want to have
    the first row selected every time the form is loaded so as to populate some
    other fields I have in the form which are bound to the grid? Anyone got any
    code that does this???

    nerd_boy Guest

  2. Similar Questions and Discussions

    1. Printing programtically
      I am trying to print from my plugin without throwing up the Print dialog, but it is not working. I am using the AVDocPrintPagesWithParams API call...
    2. cfgrid auto highlight top entry?
      Hello, I am wondering if there is a wy for cfgrid to automatically highlight the an entry as selected when the form loads in flash? Thanks in...
    3. highlight selected row of a flash <cfgrid>
      My flash <cfgrid> displays a query. The query contains two columns named 'id' and 'name'. I have one <cfgridcolumn> embeded in the <cfgrid> to...
    4. Highlight
      Is there a way to select text and add a color highlight, like say, brown behind white text? I didn't see a highliter in the toolbox and I checked ID...
    5. Help: How can I find the error in a Procedure programtically
      We have a procdure. Every night it will become invalid, but it will be recompiled automatically by our scripts. There is no bad influence on our...
  3. #2

    Default Re: CFGRID row highlight programtically

    This will do it.

    --Holly

    <cfscript>
    title = "Binding an image to a cfgrid with thumbnail";
    properties = queryNew("id,name");
    queryAddRow(properties);
    querySetCell(properties,'id','1');
    querySetCell(properties,'name','Tom');
    queryAddRow(properties);
    querySetCell(properties,'id','2');
    querySetCell(properties,'name','Dick');
    queryAddRow(properties);
    querySetCell(properties,'id','3');
    querySetCell(properties,'name','Harry');
    queryAddRow(properties);
    querySetCell(properties,'id','4');
    querySetCell(properties,'name','Sally');
    </cfscript>



    <cfsavecontent variable="onLoad">
    grdProps.setFocus();
    grdProps.setSelectedIndex(0);
    </cfsavecontent>

    <cfsavecontent variable="binding">
    {(trigger.text != '') ? trigger.dispatchEvent({type:'change'}) : 'init'}
    </cfsavecontent>


    <cfform name="mainform" format="flash" method="post" width="400"
    onchange="#onLoad#" bind="#binding#">
    <cfformgroup type="panel">
    <cfformgroup type="horizontal">
    <cfformgroup type="vbox">
    <cfgrid format="flash" query="properties" name="grdProps" width="240"
    rowheaders="no">
    <cfgridcolumn name="name" header="Name">
    </cfgrid>
    <cfinput type="text" visible="false" height='0' width="0" name="trigger"
    value="init" onchange="#onLoad#" bind="#binding#">
    </cfformgroup>
    </cfformgroup>
    </cfformgroup>
    </cfform>


    hollyjones Guest

  4. #3

    Default Re: CFGRID row highlight programtically

    This works, thx !!!

    But can you give us a few words of what is the invisible textbox and the second cfsavecontent-tag exactly does, please?

    Thx
    pope on acid Guest

  5. #4

    Default Re: CFGRID row highlight programtically

    The text input and the code in the cfsavecontent tag are a necessary workaround
    if you want to select the first item on form load because flash forms do not
    have an onload attribute.
    You can read more about that at
    [url]http://www.asfusion.com/blog/entry/onload-event-coldfusion-flash-forms-2[/url]

    Laura

    JadeBlue Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139