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

  1. #1

    Default Add Items to CFGrid

    The scenario is simple. I have a textbox where the user enters some value,
    clicks an "Add" button and I want that value to get added to a CFGrid which
    might ahve some data from before.

    I am aware of the "insertbutton" parameter for the CFGrid and that won't work
    for me. I was wondering if there is a way thru ActionScript or somehow, that
    one can programmatically add items to a given cfgrid.

    Thanks in advance,
    Saurabh.

    P.S.- Also, can anyone point me to a good resource where one can learn about
    using ActionScript in CFMX flash forms and what ActionScript methods anfd
    objects aren't available for use in CFMX 7.

    Armtusk Guest

  2. Similar Questions and Discussions

    1. Creating master page where global items arearranged ABOVE local items
      When you create a mater page, obviously all the items are arranged below anything on the individual pages. Is there a way of creating a master...
    2. Selecting items from DataSet items collection that werechanged
      hello. how to choose items from DataSet items collection that were changed (for example added to collection, changed)?
    3. possible for publishers to edit Library Items /recurrent items like navigation?
      I'd love to see this possibility too, but I think it's not possible.
    4. Adding items to a cfgrid
      Hi! I'm trying to add items to a cfgrid using form elements. E.g. I have fname textfield, lname textfield, market comboBox, etc in my form I want...
    5. possible for publishers to edit Library Items / recurrent items like navigation?
      No, you have to use an include of some sort. If you don't want to use SSI you can do it with Javascript. Search Google with the keyword "Javascript...
  3. #2

    Default Re: Add Items to CFGrid

    Hello Saurabh, I think you should try this: The grid is called Grid_Units and
    the textfield's name is BaseValue <cfinput name='Unit_Add' type='button'
    value='Add' onclick=' var varBaseValue; // A variable to hold the inserted
    text, needed because when you run the third line, the textfield was emptied
    varBaseValue = BaseValue.text; //Get the text from a textfield in the
    actionscipt variable GridData.insertRow(Grid_Units); //Add a new line to the
    grid Grid_Units.dataProvider.editField(Grid_Units.selec tedIndex, 'BaseValue',
    varBaseValue); //the dataProvider is used to get the data in the grid'> Hope
    it helps for your issue. Daniel btw -- I'm lookon for the same dokus, please
    give a link.

    Flying Condom Guest

  4. #3

    Default Re: Add Items to CFGrid

    Thanks Daniel,

    I was able to use your code and the CFMX example to get it to work.

    Here's what I did.

    <cfform format="flash">
    <cfquery name="getArtists" datasource="cfcodeexplorer">
    select * from artists
    </cfquery>
    <cfgrid name="artistGrid" query="getArtists" rowheaders="false">
    <cfgridcolumn name="firstName" header="First Name">
    </cfgrid>
    <cfformgroup type="horizontal" label="Name">
    <cfinput type="text" name="firstname" label="First">
    </cfformgroup>
    <cfinput type="button" name="btnAdd" value="Add Item"
    onclick="GridData.insertRow(artistGrid);artistGrid .dataProvider.editField(artist
    Grid.selectedIndex, 'FIRSTNAME', firstname.text);">

    </cfform>

    Links: [url]http://www.asfusion.com/blog[/url] [There are some good examples there]


    Armtusk 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