CFGRID and tbar.addButton

I've come across two promising tutorials
http://www.anujgakhar.com/2008/03/18/crud-with-cfgrid-html-format/
CRUD with cfgrid html format
which refers to Dan Vega's posts
http://www.danvega.org/blog/index.cfm/2008/3/5/ColdFusion-8-Grid-Custom-Toolbars
ColdFusion 8 Grid Custom Toolbars
both of which I have consulted and tried their code. In neither case does the toolbar appear.
I have the correct path in CF 9 to the toolbar.js
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/source/widgets/Toolbar.js"></script>
and their code
function init(){
        grid = ColdFusion.Grid.getGridObject("ArtistGrid");
        var gridFoot = grid.getView().getFooterPanel(true);
        var gridHead = grid.getView().getHeaderPanel(true);
        var bbar = new Ext.Toolbar(gridFoot);
        var tbar = new Ext.Toolbar(gridHead);
        bbar.add(new Ext.Toolbar.TextItem('Total Artists: ' + grid.getDataSource().totalLength));
        tbar.addButton({
         text:"Add New Artist",
         cls:"x-btn-text-icon",
         icon:"add.png",
         handler:onAdd
        tbar.addSeparator()
        tbar.addButton({
         text:"Delete Artist",
         cls:"x-btn-text-icon",
         icon:"delete.png",
         handler:onDelete
        console.log(tbar);
        console.log(bbar);
function onAdd(button,event){
alert("Row Added");
console.log(button);
console.log(event);
I've tried this on three different CF 9 Servers, and the tabs do not appear.
Now these posts are a few years old by now and refer to CF 8. It looks as though CF 9 doesn't support the toolbar. Is this correct?
And if so, is there some replacement for it?
The CFGRID looks really great, and I did get it to sort and actually edit rows(though I'm not sure how I did that), but not delete
or insert. If I could get the full functionality to work, this could be very valuable.

you were right.. It was the CFIDE folder which was missing
from the mapping, now the mapping, for now just to get through my
development I have uploaded the CFIDE folder into my host.. now
it's working.. for the mapping part I was reading.. all points that
I have to define a virtual folder mapping on the Apache server,
well little complex process. hope there is a easy way out from
that.. since less control I have over the server settings..
:)

Similar Messages

  • Cfgrid and href attribute issue

    HI Gang-
    I'm building a relatively simple query driven cfgrid, read-only for the most part but I need one of the columns to be a href value that will serve as a drilldown. Everything working fine except that the name/value pair I need appended to the url is being persnickety.
    The url I'd like to build and have effected in the cfgrid is something like "index.cfm?action=drilldown&orderid=#dynamicValue#"
    I finally got it to work, but not as I would like. Turns out both cfgrid and cfgridcolumn tags each have the "href" and the "hrefkey" attributes, which made for a confusing 45 minutes of trial and error.  The closest I could eventually come to my target url of:
    index.cfm?action=drilldown&orderid=#dynamicValue#
    is actually
    index.cfm?action=drilldown&CFGRIDKEY=#dynamicValue#
    Not what I wanted but I can deal for now.
    Has anyone gotten a hold of building out hrefs in cfgrid using custom name/value pairs dynamically? Would love to know how you did it. Code postings would be even better!
    Many thanks,
    Rich

    Quite a challenge, that one. You can run the following example directly. Have a look at my use of the lastName column. You could also have a look at the ext library.
    <html> 
    <head> 
         <title>Grid URL Demo</title> 
         <script type="text/javascript"> 
         function init(){ 
             var grid = ColdFusion.Grid.getGridObject("ArtistGrid"); 
             grid.addListener("rowclick",onRowClick); 
         function onRowClick(g,rowIndex,e){
           var lastName = ColdFusion.getElementValue("ArtistGrid", "artistGridForm", "lastName");
           var url = "index.cfm?action=drilldown&lastName="+lastName;
           ColdFusion.navigate(url);    
         </script>     
    </head> 
    <body> 
         <cfquery name="getArtists" datasource="cfartgallery"> 
         SELECT artistId, firstname, lastname, address, city, state, postalcode, email 
         FROM Artists 
         </cfquery> 
         <cfset args = structNew()> 
         <cfset args.name = "ArtistGrid"> 
         <cfset args.format = "html"> 
         <cfset args.query = "getArtists"> 
         <cfset args.stripeRows = true> 
         <cfset args.selectColor = "##D9E8FB"> 
         <cfset args.width = 600> 
         <h1>Artists Grid</h1>       
         <cfform name="artistGridForm" id="artistGridForm"> 
            <cfgrid attributeCollection="#args#"> 
               <cfgridcolumn name="artistid" display="false"> 
               <cfgridcolumn name="firstname" header="First Name"> 
               <cfgridcolumn name="lastname" header="Last Name"> 
               <cfgridcolumn name="email" header="Email Address"> 
               <cfgridcolumn name="address" header="Address"> 
               <cfgridcolumn name="city" header="City"> 
               <cfgridcolumn name="state" header="State"> 
               <cfgridcolumn name="postalcode" header="Zip"> 
            </cfgrid> 
         </cfform>  
         <cfset ajaxOnLoad("init")>      
    </body> 
    </html>

  • CFGRID and other CF  fielsds are missing.

    Hi,
    I have downloaded and started developing my web applicaiton
    on CF8 Developer Edition, after I reached certain extend on my
    project I decided to upload the project to my live server for a
    test run, once I did I realized that the CFGRID and DATEFIELDS are
    missing from the pages. there are no errors displaying as well, the
    CFFORMS that works on my localmachine, doesn't even respond with
    the auto validations. The live server CF version also CF 8 as they
    claim. so where could be the cause for this.?
    I see a picture missing box on IE 6 next to datefield(s).
    guess it's the calander icon.
    Thanx

    you were right.. It was the CFIDE folder which was missing
    from the mapping, now the mapping, for now just to get through my
    development I have uploaded the CFIDE folder into my host.. now
    it's working.. for the mapping part I was reading.. all points that
    I have to define a virtual folder mapping on the Apache server,
    well little complex process. hope there is a easy way out from
    that.. since less control I have over the server settings..
    :)

  • CFGRID and CFTREE applets not working

    Problem I can't figure out: On my production machine
    ColdFusion outputs an OBJECT tag for a CFGRID or CFTREE generated
    applet and everything works fine. On my dev machine (same OS
    (Windows 2003, patch level, CF 5 service pack, same code) for some
    reason ColdFusion outputs an EMBED tag for the CFGRID or CFTREE
    generated applet ... and the applet doesn't work or show up. I
    applied all patches and fixes for CF 5. I'm using XP and IE 6
    against these two systems. It has to be a ColdFusion or server
    setting somewhere. I've tried it on a number of machines and the
    Java VM version of the requesting machine doesn't seem to matter.
    Thanks!

    Hi,
    May be this
    thread
    will help you to fix your problem.

  • Cfgrid and rowStatus.Action

    I posted this under 'Rich Forms' as well (just trying to
    cover all the bases).
    I'm having a problem pulling out the rowstatus property using
    actionscript. If I use the following lines of code I receive an
    appropriate response (ie: the Index and value of contactD will
    appear in the Alert box):
    var varIndex = findReferenceResults.getSelectedIndex();
    var varID =
    _root.findReferenceResults.getItemAt(varIndex).contactID;
    alert('Variable Index: ' + varIndex);
    alert('contactID: ' + varID);
    However, when I try this:
    var varIndex = findReferenceResults.getSelectedIndex();
    var varID =
    findReferenceResults.getItemAt(varIndex).rowStatus.Action;
    alert('Variable Index: ' + varIndex);
    alert('Rowstatus: ' + varID);
    I still get my Index value, but the rowstatus.Action value
    comes back as 'undefined'.
    In the past, I've used cfgrid with cfgridupdate and with
    cfif/cfloop could determine which rows were marked for
    insertion/deletion/editing. I'm now switching over to flash forms,
    but I'm at a loss as to how to pull the rowstatus property so I
    will know which rows need insertion, etc.
    Thanks for any help you may can provide!!!!!

    Thanks man
    Frank Xu Lei--谦卑若愚,好学若饥
    [老徐的网站]:http://www.frankxulei.com/
    [老徐的博客]:http://54peixun.com/Author/frankxulei
    微软WCF中文技术论坛
    微软WCF英文技术论坛
    微软WCF技术群:166599314

  • CFGRID and Format=flash

    We have been trying to use CFGRID with format=flash. The
    following code works on our development server but not our live
    server. Both are running Windows 2000 server, IIS 6+, CFMX7.0.1
    with hotfix 2
    On the dev server the column headings and the data all appear
    as expected but on the live webserver only the column headings
    appear and the flash grid appears but no data yet is appears to
    load the data but does not show the data.
    you can test this at
    http://www.ametsoc.org/flashtest3.cfm
    The code is
    <!--- Query the database to fill up the grid. --->
    <cfquery name="qry_states" DATASOURCE="#dbdsn#"
    USERNAME="#dbuid#" PASSWORD="#dbpwd#">
    SELECT * from States
    ORDER BY StateAbbrev
    </cfquery>
    <h3>cfgrid Example</h3>
    <I>Using flash as format - on live server only the
    column names show up but not the data</i>
    <!--- cfgrid must be inside a cfform tag. --->
    <cfform name="frmGrid" method="post" action="">
    <cfgrid name = "FirstGrid"
    height="320" width="580"
    query = "qry_states"
    font="Tahoma" fontsize="12" appendkey="yes"
    griddataalign="left" gridlines="yes" rowheaderalign="left"
    colheaderalign="left" selectmode="browse" enabled="yes"
    visible="yes" format="flash" autowidth="true">
    </cfgrid>
    </cfform>

    Thanks for the response but cfdump does in fact return all
    the data. Its as if the data and grid are not binding.
    try
    http://www.ametsoc.org/flashtest3.cfm
    you will see the grid column heading no data, but the dump displays
    the data.

  • CFGrid and Application.cfc - bug??

    I don't understand what is happening here.
    If I open the cfgrid.cfm page without the Application.cfc
    file it works fine.
    With the application.cfc file the grid does not populate.
    If I comment out the cfajaximport, onrequeststart, onrequest
    and onrequestend it works fine.

    the best i could find was comment #8 by Scott Jibben here:
    http://www.forta.com/blog/index.cfm/2007/6/4/ColdFusion-Ajax-Tutorial-4-Partial-Page-Updat es
    i was apparently remembering things wrong and it is
    onRequestEnd method
    that seems to be the culprit... though i suppose depending on
    what you
    have in onRequest method may make it a collaborator too... i
    know for
    sure onRequest interferes with flash remoting and invoking
    cfc's as
    webservice...
    but why do you have <cfajaximport ...> tag in your
    Application.cfc???
    iirc, that is not a good practice - you should use it on your
    .cfm page
    in general, and in your particular case i don't think you
    need it at all.
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

  • CFGrid and checkboxes

    I have included the code.  My problem is that I am always getting the error exception thrown and not caught despite adding cftry/cfcatch blocks.  If I don't set selectmode="edit" and include OnChange my grid displays except I get the word false displayed instead of a checkbox.
    <cfgrid format="html"  name="grid_Tables" pagesize="10" autowidth="true" striperows="yes" width = "99%" selectmode="edit" bind="CFC:qry_GetUser.getAllUsers({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})"onchange="cfc:qry_GetUser.editData({cfgridaction},{cfgridrow},{cfgridchanged})">
       <cfgridcolumn name="UserID" display="No"/>
       <cfgridcolumn name="opt" header="" type="boolean" width="46"/>
       <cfgridcolumn name="Name" header="Name" width="150" type="string_nocase" select="no" />
       <cfgridcolumn name="Email" header="EMail" width="150" type="string_nocase" select="no" />
       <cfgridcolumn name="RegistrationDate" header="Registration Date" width="150" type="string_nocase" select="no" />
    </cfgrid>
    <cffunction name="editData" access="remote">
                    <cfargument name="gridaction" required="yes">
                    <cfargument name="gridrow" required="yes" type="Struct">
                    <cfargument name="gridchanged" required="yes" type="Struct">
            </cffunction>
    The problem is that in edit mode I get an error thrown so the grid
    doesn't display at all.  I am wondering if I have a problem with:
    onchange="cfc:qry_GetUser.editData({cfgridaction},{cfgridrow},{cfgridchanged})
    Right now the editData function does nothing it is empty yet an error is still being thrown.  I haven't been able to figure out where the error is being thrown.  I have added catch/try blocks around the cfgrid as well as in the editData function but nothing is caught.

    bind="CFC:qry_GetUser.getAllUsers({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{c fgridsortdirection})"
    I don't know what effect it may have, but I would remove the space for a start.

  • Cfgrid and binding to a webservice on another server

    i want to use cfgrid to bind to a CF webservice on another server via http. Is this possible and if so, what is the proper code? Ive already tried
    bind="http://notthesameserver.com/webservices/service.cfc"
    Any help would be greatly appreciated.
    GK

    nvm, i figured it out. sample below...
    bind="url:http://www.someurl.com/someserver/soemfunction()"
    thanks gk

  • CF8 CFGRID and CheckBox Not Working

    Hi,
    I am using CF 8. I have a HTML data grid using <cfgrid
    format="html">, I am trying to put a checkbox as the first
    column of the grid. I was told I could use something like:
    <cfgridcolumn type="boolean" header="Remove"
    name="remove" />
    The checkbox still doesn't show up. Any idea why?
    I am using the "bind" attribute of the cfgrid tag. It is
    bound to a CFC. I doubt that matters but thought I would mention
    it.
    Any help appreciated
    -Westside

    use selectmode attribute, for example,
    <cfgrid name="gr" format="html" selectmode="edit">

  • Cfgrid and binding checkboxes

    Hello,
    I have about 10 checkboxes that I would like to show as
    checked or unchecked in a cfform. The cfgrid does not need to show
    the checkboxes. So I have 3 columns in my cfgrid
    (firstName,lastName,company) these all bind just fine to cfinput
    type="text". There are 10 bit/boolean columns in the same database
    table that I need binded to my form. When I selected a record the
    forms update fine with the following code.
    <cfinput type="text" name="firstname" label="First"
    bind="{membersGrid.dataProvider[membersGrid.selectedIndex]['FirstName']}"
    onChange="membersGrid.dataProvider.editField(membersGrid.selectedIndex,
    'FIRSTNAME', firstname.text);">
    But when trying to do something similiar for a cfinput type
    of checkbox I get no where.
    Any assistance would be greatly appreciated.
    Thanks,
    Ryan

    Try this:
    <cfsavecontent variable="change">
    if (myGrid.selectedItem.active == 0 ) {
    myCheckBox1.selected = false;
    else {
    myCheckBox1.selected = true;
    </cfsavecontent>
    <cfform name="myForm" format="flash" height="500">
    <cfgrid name="myGrid" query="rsMyQuery"
    onchange="#change#">
    <cfgridcolumn name="field1" display="yes">
    <cfgridcolumn name="myCheckBox1" display="no">
    </cfgrid>
    <cfinput type="text" name="field1"
    bind="{myGrid.selectedItem.field1}">
    <cfinput type="checkbox" name="myCheckBox1" checked="no"
    value="0" label="myCheckBox1">
    </cfform>
    Then obviously you can spawn the logic for each additional
    checkbox in the same onchange event.
    Hope this helps.
    Joel

  • Flex 2.0 and cfgrid

    I am not a Flex developer, but I use flash format cfgrid on a
    CF 7.02 server that recently had Flex 2.0 installed
    (I believe an upgrade from 1.5). Now all I get is white space
    where the grid used to be. I had multiple functional pages
    with flash format cfgrid and they all stopped working. When I
    copy the pages to other CF 7.02 servers that
    do not have Flex installed, the pages render perfectly. I
    have tried this with 5 other CF servers and the only
    problem is the one running Flex. The developers who installed
    Flex do not have time to figure out why cfgrids
    stopped working. Is there any kind of change in the Flex
    config files that can make cfgrid co-exist with Flex?

    Yes, QTP works with Flex 3. There is more info here:
    http://flexexamples.blogspot.com/2007/12/flex-30-installing-and-configuring-flex.html
    Remember, though, that you might need to migrate your app to
    Flex 3 before automating it with Flex 3. This means updating it to
    reflect new APIs. There is an excellent series of articles on
    migration here:
    http://butterfliesandbugs.wordpress.com/2008/03/04/understanding-flex-3-migration-issues-p art-i/
    hth,
    matt horn
    flex docs

  • CF9 problems with Grid and getHeaderPanel

    This code no longer works in CF9
    var grid = ColdFusion.Grid.getGridObject('maingrid');
        var gridHead = grid.getView().getHeaderPanel(true);
        var tbar = new Ext.Toolbar(gridHead);
                tbar.addButton({
                      text:'Add Animated Image',
                      icon:'images/image_add.png',
                      cls:'x-btn-text-icon',
                      tooltip:'Add',
                      handler: function(){
                      var record = grid.getSelections();
                          <-- Do something -->
    I just get an errorError:  grid.getView().getHeaderPanel is not a function
    I've tried numerous alternatives looking through the documentation but I can't get the header of a cfgrid to display buttons anymore in CF9, works fine in CF8, can anyone help

    Wow. I feel silly that it could have been such a simple thing.  Seems to have taken care of the problem.  I must not have been paying attention to where I was clicking.  Thanks!

  • After upgrading to CF10, the selected row of my cfgrid is no longer passed on form post.

    I have a cfform which contains a cfgrid and prior to the 9 to 10 update, upon submission of the cfform, the selected row of the grid was passed/posted to my form action page as:
    __CFGRID__gridForm__renewalGrid
    This contained all the data from the selected row, I.e.:
    __CFGRID__COLUMN__=PROJECTID; __CFGRID__DATA__=T01081002AP; __CFGRID__COLUMN__=APPLICATIONS; __CFGRID__DATA__=PQFD; __CFGRID__COLUMN__=OWNERUID; __CFGRID__DATA__=HT2008; __CFGRID__COLUMN__=TEAM; __CFGRID__DATA__=Roberts; __CFGRID__COLUMN__=ROLE; __CFGRID__DATA__=AASBOAPMX; __CFGRID__COLUMN__=REGION; __CFGRID__DATA__=Southwest; __CFGRID__COLUMN__=EXISTING; __CFGRID__DATA__=K8045F; __CFGRID__COLUMN__=SOD; __CFGRID__DATA__=0; __CFGRID__COLUMN__=INITIALEMAILDATE; __CFGRID__DATA__=01/28/2013; __CFGRID__COLUMN__=MESSAGEDATE; __CFGRID__DATA__=; __CFGRID__COLUMN__=SECONDEMAILDATE; __CFGRID__DATA__=; __CFGRID__COLUMN__=ESCALATIONDATE; __CFGRID__DATA__=; __CFGRID__COLUMN__=COMPLETEDBY; __CFGRID__DATA__=TH2878; __CFGRID__COLUMN__=COMPLETIONDATE; __CFGRID__DATA__=02/06/2013; __CFGRID__COLUMN__=MONTHPULLED; __CFGRID__DATA__=Jan2013; __CFGRID__COLUMN__=TOTALITEMS; __CFGRID__DATA__=2; __CFGRID__COLUMN__=RELIEVINGPSA; __CFGRID__DATA__=; __CFGRID__COLUMN__=MODIFIEDBYTS; __CFGRID__DATA__=02/06/2013; __CFGRID__COLUMN__=MODIFIEDBY; __CFGRID__DATA__=T228Y8; __CFGRID__COLUMN__=CREATEDBY; __CFGRID__DATA__=KV3M36; __CFGRID__COLUMN__=CREATEDTS; __CFGRID__DATA__=01/28/2013; __CFGRID__COLUMN__=NEWSA; __CFGRID__DATA__=; __CFGRID__COLUMN__=DELEGATESTATUSNOTE; __CFGRID__DATA__=Access; __CFGRID__COLUMN__=STATUS; __CFGRID__DATA__=Completed; __CFGRID__COLUMN__=DATATYPE; __CFGRID__DATA__=Appl New
    After upgrading to CF10, and with no changes to the code, performing this same process, __CFGRID__gridForm__renewalGrid is still passed in the form scope to my action page, but now it is empty.
    I have not yet uninstalled CF9, so I brought it up on a different port, and I can run the same code as CF9 or CF10 and watch... in 9 the selected row is passed, in 10 it is empty.
    Is this a bug? Is there a work around? Please help.

    appears that apple has changed SMB code, and now its not possible login from windows on mac.
    i installed snow leopard and now works fine.
    apple is capable to make it run paying new license of smb code, but isnted of this, apple has created new protocol smbx and now, all others need to adapt your code to apple..
    bad movement.. i am thinking sell imac and no back to apple anymore..

  • Very Strange error and can't find any answer anywhere in the net

    I created a login form (see below).
    If I use the regular HTML form and form fields for the username, password and submit button I don't get any problem viewing my form
    But if I use cfform and cfinput form fields I get this error.
    Here is my cfform codes:
    cfform name="login" action="/login/checkLogin.cfm" method="post">
      cfinput type="text" name="username" size="25" required="Yes" message="Please enter your username">
      cfinput type="password" name="password" size="25" required="Yes" message="Please enter you password">
       cfinput type="submit" value="Sign In">
    /cfform>
    When I launch this page I get this error and I don't understand what this means and what am I supposed to do, please help!
    Total Time Avg Time Count Template
    1 ms 1 ms 1 /opt/coldfusion10/cfusion/wwwroot/CFIDE/administrator/templates/secure_profile_error.cfm
    0 ms 0 ms 1 top level /home/space/users/www/webdocsec/login/login.cfm
    19 ms   STARTUP, PARSING, COMPILING, LOADING, & SHUTDOWN
    20 ms   TOTAL EXECUTION TIME
    red = over 250 ms average execution time
    Exceptions
    10:08:08.008 - Template Exception - in : line -1
         Attribute validation error for tag CFINPUT.

    Using cfform
    To start with, leave cfform aside. You will find in the documentation that most developers are abandoning Coldfusion's native UI tags, for example, cfform, cfgrid, and so on. They are outdated and occasionally perform erratically. If you wish to validate forms, use a Javascript library such as jQuery.
    Implementing Site-Wide Error Handler
    By default, there is no site-wide error handler configured. It is advisable to create your own. Then register the path of the page in the Coldfusion Administrator.
    As the name implies, it is a CFM page which ColdFusion runs when it encounters an error on your site. Creating your own enables you to present a simple, customized, user-friendly page to your visitors.
    Alternatively, you may choose to implement a Secure Profile. This is available in the Administrator, on the page Security => Secure Profile.
    When you check the box, you configure Coldfusion to automatically implement all the security measures listed in the table. That includes Coldfusion's own the Site-Wide Error Handler. It is the system file, /CFIDE/administrator/templates/secure_profile_error.cfm.

Maybe you are looking for

  • XI testing POS Integration Scenario

    Hi Folks , I am new to XI environment and have a query: I am configured a process integration scenario for sending TLOG to POSDM. Can you pl advice how can I go about testing my config. At present I do not have any POS-GM system running so I was wond

  • Help required in Material master new view extension

    Hi, I have created one additional view for matrial master , i have added few custom fields in that i am able to save the records. but i am facing problem if i use already used fields in other views  in my view  and it is saying "Maintenance status of

  • How to calculate Deadline Date and Time

    A support desk message has been created and support team has to respond in fixed time duration. Creation time of message and duration of response are available. How to calculate the exact time and date where this deadline expires using the factory ca

  • Contents of a Flash file

    Hi First I need to say that I am not used to flash, so it might be a fairly simple question. I've received some FLAs to translate and a structured folder with some SWFs inside for reference. The SWF files shows a rich dinamic presentation but the FLA

  • Spacewalk quickstart for Oracle linux 6.1

    I have spacewalk installed following the instructions at https://fedorahosted.org/spacewalk/wiki/HowToInstall. I am completely stuck regarding what to do next. My question is, how do I register my new spacewalk server with oracle linux network in ord