Cfgrid hiding and showing columns dynamically

I am trying to get my grid and some checkboxes to integrate
with each other in order to show and hide different columns through
actionscript. I am using the code found at this website:
http://www.asfusion.com/blog/entry/mxna-reader-built-with-cfforms
and I have been having no luck in trying to implement it. I
would like to do away with the .as files that come along with this
code but I can't get it to work with or without it. Does anybody
know how to do this, I am at a loss and I need to get it working
soon.
Thanks in advance!
Jeff
Here's the code I have been working with:
<cfformitem type="script">
<!---
function _global.hideColumns()
_global.postColumns = [];
for(var i =0; i< contactList2.columnCount; i++)
_global.postColumns.push(posts.getColumnAt(i));
contactList2.removeColumnAt(6);
contactList2.removeColumnAt(5);
contactList2.removeColumnAt(4);
contactList2.removeColumnAt(3);
function _global.setColumn(target, col)
if(target.value)
contactList2.addColumn(_global.postColumns[col.index]);
contactList2.spaceColumnsEqually();
contactList2.getColumnAt(0).width = 0;
else
for(var i = 0; i< contactList2.columnCount; i ++)
if(contactList2.getColumnAt(i).columnName == col.data)
contactList2.removeColumnAt(i);
</cfformitem>
<cfform action="#cgi.script_name#" method="post"
name="form" preservedata="true" preloader="yes" format="flash"
height="605" width="765" skin="haloblue"
style="themeColor:##56A1E1; marginRight:0;
background-color:##7B8DA1;">
<cfgrid name="contactList2" query="GetActivity"
rowheaders="false" height="365" colheaderalign="center"
colheaderfontsize="12" colheaderbold="yes"
onchange="getUrl('act_view.cfm?ActivityID=' +
contactList2.dataProvider[contactList2.selectedIndex]['ActivityID']);">
<cfgridcolumn name="ActivityID" display="no">
<cfgridcolumn name="Title" header="Activity Title"
width="150">
<cfgridcolumn name="Details" header="Details">
<cfgridcolumn name="SiteArea" header="Site Area"
width="70">
<cfgridcolumn name="Mission" header="Mission"
width="70">
<cfgridcolumn name="Date" header="Activity Date"
mask="mm/dd/yyyy" width="95">
</cfgrid>
<cfformgroup type="horizontal" height="14">
<cfinput type="text" name="columns" visible="no"
label="Check here to show columns:" width="0">
<cfinput type="checkbox" name="chktitle" checked="true"
label="Title" onClick="_global.setColumn(chktitle, {index:1,
data:'title'})">
<cfinput type="checkbox" name="chkdetails" checked="true"
label="Details" onClick="_global.setColumn(chkdetails, {index:2,
data:'details'})">
<cfinput type="checkbox" name="chkSite" checked="false"
label="SiteArea" onClick="_global.setColumn(chkSite, {index:3,
data:'siteArea'})">
<cfinput type="checkbox" name="chkMission"
checked="false" label="Mission"
onClick="_global.setColumn(chkMission, {index:4,
data:'mission'})">
<cfinput type="checkbox" name="chkDate" checked="true"
label="Date" onClick="_global.setColumn(chkDate, {index:5,
data:'Date'})">
</cfformgroup>
</cfform>

Hmm. Perhaps the problem is that when these columns are hidden or shown, the data is cleared out so there is nothing visible in any column.  Still, shouldn't the width stay static according to the width I specified for each column?  It seems like a bug, really, but I'm not sure why it seems uncommon.
Unfortunately an upgrade to Flex 3 isn't possible at the moment, I don't think.

Similar Messages

  • Hiding and showing columns in JTable

    Hi
    When I use removeColumn on a JTable I see that
    it also disapears from the tablecolumnmodel. (I thought that the jtable was the view and the data would remain in the tablecolumnmodel)
    So how do I show the column again ?
    //I used the following
    TableColumnModel colModel = table.getColumnModel();
    TableColumn tc = table.getColumn("header one");
    table.removeColumn(tc);
    Thanks
    Tim

    You are misreading it (I believe). The column is removed, but the data still exists in the model. The information about the column itself is lost.
    What I did, when columns are removed (I call it hiding), I remove them from the table and keep them in an arraylist. When I want to bring them back, I find it in the arraylist, add it back to the table and then move it to the correct place.

  • Data grid within advanced data grid (Hiding and showing columns)

    Hi,
    I have a dta grid within advanced datagrid. When the row of advanced data grid is expanded, the datagrid opens up.
    I want to control the columns of datagrid based on the value of a field in advanced data grid. I want to show all the columns of the datagrid if the field value of advanced data grid is "X" else I want to show only few columns of the data grid.
    I will set the id for all the columns of the datagrid. Then I think I can write some code in a method to set the visibility of the columns and assign the function to item opening property of the advanced data grid.
    Please give me some ideas.
    Regards,
    Mahee   

    Hi,
    Please go through following links:
    http://www.cflex.net/showFileDetails.cfm?ObjectID=553
    http://flexmusings.wordpress.com/2009/08/03/hide-row-column-datagrid/
    http://www.java2s.com/Code/Flex/Grid/HidinganddisplayingDataGridcolumns.htm
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • How to fetch Junk values and its columns dynamically

    Hello,
    Can anyone help me in writing a procedure/dynamic SQL to fetch the column where the junk values appears and its value. Eg: If emp table contains ID and Name columns, and ID column contains junk values, the result should be the Id column and the junk value/s. It should be dynamic because next time if the other column contains junk values(like $,%...), the query should display the other column too..
    Thanks in advance..

    Can anyone help me in writing a procedure/dynamic SQL to fetch the column where the junk values appears and its value. Eg: If emp table contains ID and Name columns, and ID column contains junk values, the result should be the Id column and the junk value/s. It should be dynamic because next time if the other column contains junk values(like $,%...), the query should display the other column too..1. define "junk" values.
    2. usually it does not matter what values are in ID, because it is used internally by application, to maintain uniqueness or relations, not having any semantical meaning. End users usually should not see IDs, such IDs are generated automatically. There is no need to cleanse them from "junk" values.
    3. If you made a typo, and you are looking for "junk" values in Name column, it is a different story. You can use TRANSLATE to search such values, as already advised, translating all "junk" characters to one "junk" character and searching for the latter.
    select id, name from T where translate(name,'?@#$%^<>','~~~~~~~~~') like '%~%';
    Edited by: Mark Malakanov (user11181920) on Jan 4, 2013 11:40 AM

  • Hide and show portlet dynamically

    i have two pages each page contains one one portlets. in this scenario i can hide/show
    the respective pages.
    Is there any other ways to hide/show porltets dynamically from portal.
    thanks in advance.
    shashi

    put a backing file on the portlet and from the backing file (probably pre render
    method)
    set the visibile to false
    PortletBackingContext portletBackingContext = PortletBackingContext.getPortletBackingContext(request);
    portletBackingContext.setVisible(false);
    If that doesn't work for some reason you can set the state to "delete" wil need
    to do this from
    the init method on the backing file
    PortletBackingContext portletBackingContext = PortletBackingContext.getPortletBackingContext(request);
    portletBackingContext.setupStateChangeEvent(WindowCapabilities.DELETE.getName());
    You can also use entitlements if this is a security thing.
    "shashishekar" <[email protected]> wrote:
    >
    i have two pages each page contains one one portlets. in this scenario
    i can hide/show
    the respective pages.
    Is there any other ways to hide/show porltets dynamically from portal.
    thanks in advance.
    shashi

  • How can i hide and display columns dynamically

    Hi,
    Is such a thing possible in BeX.?????
    Following is the reqiurement.
    Number of columns with the forecast values are to be from Forecast 1&2 till the month before the chosen selection. In order for us to calculate the variance, you should have 2 forecast values. 
    If March is chosen please show Forecast 1& 11, Forecast 2&10
    If April is chosen please show Forecast 1& 11, Forecast 2&10, Forecast 3&9.
    If November is chosen please show Forecast 1& 11, Forecast 2&10, Forecast 3&9, Forecast 4&8, Forecast 5&7…………..Forecast 10&2.
    Please guide how can this be achieved.
    Regards,
    Rathy

    Hi,
    well at least you can use some vba macros to achieve that. Best would be to have a static query embedded in a workbook and a sheet where the results are displayed as copies from the query via a macro.
    regards
    Siggi

  • Hiding and showing Flash Player causes a reload

    I have a Flex application embedded in an IFRAME that is
    inside a DIV.
    If I hide the DIV and then make it visible, the application
    reinitializes itself. Is there a way to keep this from
    happening?

    Instead of showing/hiding the DIV, you could try to change
    its size to 1px height and 1px width.
    I guess it's not a real good way to do it, but it may works
    :)

  • Hide and show columns

    Hi Guys,
    I'd like to control some columns show or hide by a option input from user interface. I can assigne the user's input to a parameter and use that parameter to suppress sections which contains to-be-hidden columns. I use section's underly merge them together when those columns needs shown. but when I hide columns, there are some empty space occupied by the hidden fields, how can I overcome it?
    Thank  you very much
    Clara

    There are THREE very recent threads where the poster is looking to do similar things, [here|Fetching Columns in For Loop; , [here|End User Customisation at Runtime; and another I can quite put my finger on.  Interestingly, each give different solutions to the problem.
    Please search the forum prior to posting your question.
    HTH,
    Carl

  • Trouble hiding and showing captions with a single button

    I am trying to show a caption (MSO) with the click of a button and then hide it again with the same button. I have created a MSO with two states one with the text, one without and then created an icon with a plus sign [normal] that triggers the second state that has the text. After the button is pressed it changes to a minus sign [click] the next step is where I am running into trouble. I just want the user to be able to click the minus button to hide the caption before moving on to the next page or article. I have tried every button state combination but can't hide the caption short of creating a new button somewhere else on the page, this is not desired. I have seen this function in publications like National Geographic, and Vogue so I know it is possible. It seems so simple but I can't figure it out. Being able to close the caption after showing it will add another level of interaction and professionalism to my publication...please help someone.

    Being inmersed in this thing, I am gathering some instructions and notes about very basic DPS things for our working team use and my Spanish speakers readers. Here you have the first one: Cómo hacer que un pie de foto se muestre al pulsar encima de la imagen en InDesign para DPS
    They are based in Bob Bringhusrt's DPS tips —thanks a lot!—, what I have read in this forum and the Adobe's help data.
    There's a translate button that works quite fine.
    Is that of any help? Hope so
    Gustavo (Posting from heat-melting Madrid)

  • Hiding and showing borders on tables nested inside other tables

    I'm using this code:
    <?CHOOSE:?><?WHEN:position() > 1 ?><?attribute@incontext:border-top-color;'black'?>
    <?attribute@incontext:border-top-style;'solid'?>
    <?attribute@incontext:border-top;'0.25pt'?>
    <?end when?>
    <?end choose?>
    I want the top border to apply to the entire row, not just the cell. This is probably easy syntax but it isn't accepting anything i throw at it.
    Edited by: CISguy on Feb 23, 2010 4:32 PM
    Edited by: CISguy on Feb 24, 2010 10:49 AM

    I got it to work, but I think the PDF output is just buggy and code only works when it wants to. If anyone else is trying to use a table inside a table and is facing the "unexpected thick table border" issue, this is because of the table borders stacking on top of each other. I got it to work by disabling almost all borders on the inner table and using this code to show a border when i wanted it to.
    <?if@row:position() >1?>
    <?attribute@incontext:border-top-color;'black'?>
    <?attribute@incontext:border-top-style;'solid'?>
    <?attribute@incontext:border-top;'0.25pt'?>
    <?end if?>

  • Hideing and showing a page or security for some pages

    i have developed an applciation where in which i want users to have acces
    to some pages and some pages are secured they can be viewed only after entering some credentials.
    how can we do this some body help me

    Create an authentication scheme and an authorization scheme (under Shared components)
    and in the page attributes (top left) you can select these schemes to be active for the page.
    Hope this helps.
    Leo

  • Hiding and restoring table columns from file?

    how i handle hiding and unhiding columns in a jtable is that i have a checkbox for each column, depending on which is checked "on" the tablecolumn is found and added to a vector and removed from the table.
    when the checkbox is checked "off" this vector is searched for the correct tablecolumn, and then added back to the table. this works fine.
    when i close out of the program, i go thru the table and write the visible column names along with its size to file.
    when i re-open the program, i create the table normally, then go thru the file and hide(remove) the tablecolumns found in it..this works fine.
    but when i go back to this checkbox list and try to unhide the tablecolumn, i get an exception
    java.lang.IllegalArgumentException: Cannot format given Object as a Number
         at java.text.NumberFormat.format(NumberFormat.java:219)
         at java.text.Format.format(Format.java:133)
         at javax.swing.JTable$DoubleRenderer.setValue(JTable.java:3397)
         at javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent(DefaultTableCellRenderer.java:160)
         at javax.swing.JTable.prepareRenderer(JTable.java:3731)
         at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1149)
         at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1051)
         at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:974)
         at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
         at javax.swing.JComponent.paintComponent(JComponent.java:541)
         at javax.swing.JComponent.paint(JComponent.java:808)
         at javax.swing.JComponent.paintChildren(JComponent.java:647)
         at javax.swing.JComponent.paint(JComponent.java:817)
         at javax.swing.JViewport.paint(JViewport.java:722)
         at javax.swing.JComponent.paintChildren(JComponent.java:647)
         at javax.swing.JComponent.paint(JComponent.java:817)
         at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4787)
         at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4740)
         at javax.swing.JComponent._paintImmediately(JComponent.java:4685)
         at javax.swing.JComponent.paintImmediately(JComponent.java:4488)
         at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)
         at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)before i unhide the columns, the table is already populated with values. so it might have something to do with that...cuz there is no problems unhiding them if the table contains no data
    any ideas?
    thanks

    If you're interested, this method hides a table column without any modifications of its content:
       public static void setTableColumnVisible(JTable table, int col,                                                                             
                                                  boolean visible, int width) {
          try {
             TableColumn column = table.getColumnModel().getColumn(col);
             if (!visible) {
                column.setMinWidth(0);
                column.setWidth(0);
                column.setMaxWidth(0);
                column.setPreferredWidth(0);
             else {
                column.setWidth(width);
                column.setPreferredWidth(width);
          catch(Exception e) {
             e.printStackTrace();
       }Method use:
    . setTableColumnVisible(table, col, false, 0) hides the column
    . setTableColumnVisible(table, col, true, 100) restores the column to its size of 100
    Hope this helped,
    Regards.

  • Hide and show tab canvas

    Is it possible to disable all the tabs in a tab canvas in Forms 10g?
    I am developing a new form in Forms 10g. Problem is with hiding and showing tab canvases.
    I have a main canvas and a tab canvas.
    In the when-new-form-instance I need to hide the two tabs. I have a list item that has two values. Based on the value chosen in the list I need to show the tab canvas. How can I do it. I tried hide_view and show_view. It gives me an error FRM-41053. Cannot find canvas Invalid ID.
    Help is appreciated. Thaks in advance
    Anu

    If you are looking to hide individual tabs on a tabbed canvas, refer to SET_TAB_PAGE_PROPERTY
    http://www.oracle.com/webapps/online-help/forms/10g/topics/f1_help/builts/f50settppr.html

  • HIDE/SHow Column Saving preferences

    Hello All,
    I am trying to have a report that allows users to hide and show columns.
    I have looked at the example on this link
    http://htmldb.oracle.com/pls/otn/f?p=31517:78:1596122781426415::NO:::
    My only issue is:
    How do you save the preferences, as I cannot seem to see how its done on the link
    Frank

    Hi,
    Recently I met the same question and the solution is , give column level security in presentation layer by
    * Click the column
    * In general tab permission tab is there, give access to specific users and save.
    Now when you login with the user and see the column, it will throw error. In order to avoid that
    Change the following property in security section of nqsconfig file
    * PROJECT_INACCESSIBLE_COLUMN_AS_NULL     =     yes;
    It works.
    Regards,
    Anitha.B

  • Is it possible to show/hide dynamically columns in RDLC form?

    We need to show/hide dynamically columns in our Report RDLC form based by the user desire needs.
    We need by the predefined checkboxes to set which columns should be seen and which should be hidden.
    Is it possible in RDLC form to make it "show/hide columns dynamically" with any way?

    Depends on what you mean dynamically, you still need to press the view report button.
    What you can do is right click on the column you want to be able to hide/display in design mode,
    click "Column visibilty", choose "show or hide based on an expression" then in your expression base your true or false on a boolean parameter for each column

Maybe you are looking for

  • Don't want to use my flash as a slave.

    I want to use my 430 ex ii on my Canon 7D mk ii, can I disable my pop up flash forever?

  • Regarding Oracle 10G Developer Suite On Oracle 9i R2

    Actually i am new to oracle *9i R2* because i worked on Oracle 7 in that i was getting by default forms and reports will be installed. after inquiring with my friends they said that in oracle *9i R2* there wont be forms and reports installed for that

  • Product Cost Sheet report from BW

    Hi, I would like to know if somone has generated the cost sheet report for product/material combination in BW. I have a requirement for report as follows: Cost Sheet for FG 101                                           Qty     Uom    Price    Resourc

  • Trial Balance in Alphabet Order

    Hi Experts ,                      Is it possible to take print out of Trial Balance in alphabet order ? Thanks

  • How to  become master

    this is typical question even though , how deep we know about sap mm be a best consultant and which area should be perfect thanks for suggetion g