Thanks Blair & Geoff!  I tried using the typeadmincolumn attributes but
couldn't get that working.  I used Blair's suggestion of copying the
default columns & reworking them for my purposes, and it worked.  Not
very elegant, but it does the trick.  I'll try again w/
typeadmincolumns soon, & if I can get it working, I'll post the code.

This is the resulting code of the successful attempt to replace the
field label with my custom field unitName:

<cfimport taglib="/farcry/farcry_core/tags/widgets/" prefix="widgets">



<!--- set up columns --->

<cfscript>
        //This data structure is used to create the grid columns
        //remember to delimit dynamic expressions ##
        aDisplayColumns=arrayNew(1);
        mytypename = "ocUnit";

        editobjectURL =
"#application.url.farcry#/conjuror/invocation.cfm?objectid=##recordset.objectID[recordset.currentrow]##&typename=#mytypename#&ref=typeadmin";

        //select
        stCol=structNew();
        stCol.columnType="expression";
        
stCol.title="#application.adminBundle[session.dmProfile.locale].select#";
        stCol.value="<input type=""checkbox"" class=""f-checkbox""
name=""objectid"" value=""##recordset.objectid##""
onclick=""setRowBackground(this);"" />";
        stCol.style="text-align: center;";
        //stCol.orderby="";
        arrayAppend(aDisplayColumns,stCol);

        //edit icon
        stCol=structNew();
        stCol.columnType="evaluate";
        stCol.title="#application.adminBundle[session.dmProfile.locale].edit#";
        stCol.value="iif(stPermissions.iEdit eq 1,DE(iif(locked and lockedby
neq
'##session.dmSec.authentication.userlogin##_##session.dmSec.authentication.userDirectory##',DE('<span
style=""color:red"">Locked</span>'),DE('<a
href=''#editObjectURL#''><img
src=""#application.url.farcry#/images/treeImages/edit.gif""
alt=""#application.adminBundle[session.dmProfile.locale].edit#""
title=""#application.adminBundle[session.dmProfile.locale].edit#""/></a>'))),DE('-'))";
        stCol.style="text-align: center;";
        //stCol.orderby="";
        arrayAppend(aDisplayColumns,stCol);

        //preview
        stCol=structNew();
        stCol.columnType="expression";
        stCol.title="#application.adminBundle[session.dmProfile.locale].view#";
        stCol.value="<a
href=""#application.url.webroot#/index.cfm?objectID=##recordset.objectID##&flushcache=1""
target=""_blank""><img
src=""#application.url.farcry#/images/treeImages/preview.gif""
alt=""#application.adminBundle[session.dmProfile.locale].view#""
title=""#application.adminBundle[session.dmProfile.locale].view#""
/></a>";
        stCol.style="text-align: center;";
        //stCol.orderby="";
        arrayAppend(aDisplayColumns,stCol);

        /*NOTE THIS IS THE ONE I EDITED

        //label and edit
        stCol=structNew();
        stCol.columnType="evaluate";
        stCol.title="#application.adminBundle[session.dmProfile.locale].label#";
        stCol.value = "iif(stPermissions.iEdit eq 1,DE(iif(locked and lockedby
neq
'#session.dmSec.authentication.userlogin#_#session.dmSec.authentication.userDirectory#',DE('##replace(recordset.label[recordset.currentrow],'####','','all')##'),DE('<a
href=''#editObjectURL#''>##replace(recordset.label[recordset.currentrow],'####','','all')##</a>'))),DE('##replace(recordset.label[recordset.currentrow],'####','','all')##'))";
        stCol.style="text-align: left;";
        stCol.orderby="label";
        arrayAppend(aDisplayColumns,stCol);

        */

        //unitName and edit
        stCol=structNew();
        stCol.columnType="evaluate";
        stCol.title="Unit Name";
        stCol.value = "iif(stPermissions.iEdit eq 1,DE(iif(locked and lockedby
neq
'#session.dmSec.authentication.userlogin#_#session.dmSec.authentication.userDirectory#',DE('##replace(recordset.unitName[recordset.currentrow],'####','','all')##'),DE('<a
href=''#editObjectURL#''>##replace(recordset.unitName[recordset.currentrow],'####','','all')##</a>'))),DE('##replace(recordset.unitName[recordset.currentrow],'####','','all')##'))";
        stCol.style="text-align: left;";
        stCol.orderby="unitName";
        arrayAppend(aDisplayColumns,stCol);


        //status
        if (structKeyExists(application.types[mytypename].stprops, "status"))
{
                stCol=structNew();
                stCol.columnType="value";
                
stCol.title="#application.adminBundle[session.dmProfile.locale].status#";
                stCol.value="status";
                stCol.style="text-align: center;";
                stCol.orderby="status";
                arrayAppend(aDisplayColumns,stCol);
        }

        //lastupdatedby
        stCol=structNew();
        stCol.columnType="value";
        stCol.title="#application.adminBundle[session.dmProfile.locale].by#";
        stCol.value="lastupdatedby";
        stCol.style="text-align: center;";
        stCol.orderby="lastupdatedby";
        arrayAppend(aDisplayColumns,stCol);
</cfscript>


<!--- Invoke typeAdmin with aColumns attribute --->

<widgets:typeAdmin
permissionSet="News"
metadata="True"
title="Staff Directory Units Administration"
description="Top level object of Staff Directory"
handlerRoot="/#application.applicationname#/handlers"
typename="ocUnit"
aColumns="#aDisplayColumns#"
>
</widgets:typeAdmin>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"farcry-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/farcry-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to