What is the best way to show/hide n number of columns ?

Hi,
I have a dynamic report that I have show/hide columns working using the below code. But when there are 500 or more rows it takes about a minute or more just waiting to see the columns toggle.
What is the best way to do this?
// Existing Javascript
[script language="JavaScript" type="text/javascript"]
var maxcnt= mymonths.length;
function hideMaxEarn(){
for(var j=0;j[maxcnt;j++){
hideColumn('MON'+mymonths[j],'MAXCOL'+mymonths[j]);
hideColumn('MON'+mymonths[j],'EARNCOL'+mymonths[j]);
hideColumn('MON13','MAXCOL13');
hideColumn('MON13','EARNCOL13');
function showMaxEarn(){
for(var j=0;j[maxcnt;j++){
showColumn('MON'+mymonths[j],'MAXCOL'+mymonths[j]);
showColumn('MON'+mymonths[j],'EARNCOL'+mymonths[j]);
showColumn('MON13','MAXCOL13');
showColumn('MON13','EARNCOL13');
function getCellIndex(pRow,pCell){ 
for(var i=0, n=pRow.cells.length;i[n;i++){ 
    if(pRow.cells[i] == pCell) return i;
function hideColumn(pMon,pCol){
var l_Cell = $x(pCol);
var l_Table = html_CascadeUpTill(l_Cell,'TABLE');
var l_Rows = l_Table.rows;
l_CellI = getCellIndex(l_Cell.parentNode,l_Cell);
for (var i=0, n=l_Rows.length;i[n;i++){
    if(i != 0) {
       html_HideElement(l_Rows[i].cells[l_CellI]);
} else {
$x(pMon).colSpan = $x(pMon).colSpan - 1;
function showColumn(pMon,pCol){
var l_Cell = $x(pCol);
var l_Table = html_CascadeUpTill(l_Cell,'TABLE');
var l_Rows = l_Table.rows;
l_CellI = getCellIndex(l_Cell.parentNode,l_Cell);
for (var i=0, n=l_Rows.length;i[n;i++){
    if(i != 0) {
       html_ShowElement(l_Rows[i].cells[l_CellI]);
} else {
$x(pMon).colSpan = 3;
return;
[script]

Hi Andy,
Yes, I replaced the code calling the same things in a loop to one loop getting the Table reference once and I build an array of column numbers at the time the report is built so I don't have to get the column number each time....
it is a couple of seconds faster in about a 30 second response time. It will have to do it for now, no more time unless you see something in this new code...
Thank you! Bill
// dynamically built code
col_nbr_array = new Array();
col_nbr_array[0] = "1";
col_nbr_array[1] = "2";
col_nbr_array[2] = "4";
col_nbr_array[3] = "5";
col_nbr_array[4] = "7";
col_nbr_array[5] = "8";
col_nbr_array[6] = "10";
col_nbr_array[7] = "11";
col_nbr_array[8] = "13";
col_nbr_array[9] = "14";
col_nbr_array[10] = "16";
col_nbr_array[11] = "17";
col_nbr_array[12] = "19";
col_nbr_array[13] = "20";
col_nbr_array[14] = "22";
col_nbr_array[15] = "23";
col_nbr_array[16] = "25";
col_nbr_array[17] = "26";
col_nbr_array[18] = "28";
col_nbr_array[19] = "29";
col_nbr_array[20] = "31";
col_nbr_array[21] = "32";
col_nbr_array[22] = "34";
col_nbr_array[23] = "35";
col_nbr_array[24] = "37";
col_nbr_array[25] = "38";
col_nbr_array[26] = "40";
col_nbr_array[27] = "41";
// Static code
function show_hide_column(do_show) {
// Set Style, Show/Hide
var stl;
var csp;
if (do_show){
stl = 'block'
csp = 3;
}else{
stl = 'none';     
csp = 1;     
// get rows object
var l_Rows = document.getElementById('DT_RANGE').rows;
var totCellNbr1=parseFloat(col_nbr_array[maxcnt-1])+2;
var totCellNbr2=totCellNbr1 +1;
var n=l_Rows.length;
for (var i=0; i[n;i++){
    if(i != 0) { // if not the main header which spans 3 cols when expanded
      // Go through and show/hide each cell
      for(var j=0;j[maxcnt;j++){
          l_Rows[i].cells[col_nbr_array[j]].style.display = stl;
// Totals
l_Rows.cells[totCellNbr1].style.display=stl;
l_Rows[i].cells[totCellNbr2].style.display=stl;
} else { // row 1 that has Month spelled out - colspan of 3, others has max,earned and score columns for each month.
var maxhdr = maxcnt/2;
for(var k=1;k[=maxhdr;k=k+1){
//alert('Header['+k+']');
l_Rows[i].cells[k].colSpan=csp;
// Total column
//alert('TotHeader['+(maxhdr+1)+']');
l_Rows[i].cells[maxhdr+1].colSpan=csp;
[script]

Similar Messages

  • What is the best way to show a message on page "Planning Workspace"

    Hi,
    I would like to warn my users about the update of the data. Is it possible to show a message on page "Planning Workspace Home"
    Thanks !

    Hi!
    Have a look at Broadcast massages http://download.oracle.com/docs/cd/E12825_01/epm.111/hp_admin.pdf
    read chapter "Using Broadcast messeging"
    regards
    alexander

  • What is the best way to add a large number dynamic VI's in the application builder?

    Is there a way to add all the VI's in a directory tree or library file as "Dynamic VI's" in the application builder (7.1 on Windows XP SP2)?
    Thanks,
    Mark Moss

    LabVIEW 7.1: From what I can tell, you can only add dynamic VIs one file at a time, while for support files, you can add entire folder contents.
    Have you considered uprading to LabVIEW 8.0? Things like this have been improved dramatically! You can keep all your dynamic VIs in a project folder, then add it to the build specification in one click.
    LabVIEW Champion . Do more with less code and in less time .

  • I have lightroom 5.7. Now I have apple TV to connect my Mac to the TV scree. I wish to do a slide show on the TV. However, on the Mac, using ITunes to share photos with the TV, I cannot locate all photo files. What is the best way to save the slide show a

    I have lightroom 5.7. Now I have apple TV to connect my Mac to the TV scree. I wish to do a slide show on the TV. However, on the Mac, using ITunes to share photos with the TV, I cannot locate all photo files. What is the best way to save the slide show and put it where the Mac sharing can find it? So far, I made on one folder in Lightroom, put some photos there and I found them easily. Can this be done with a slide show? Please help quickly! Also worried that the photos I put on the new folder are hard to find afterwards, when the show is done. Where do they go when I delete from from the new folder?I am not alone

    Not that I'm aware of. You just export JPEG copies to a folder that you can point iTunes to. For instance, I have created a folder in my Pictures folder called Apple TV. And within that folder I have other folders of pictures that I can choose from in iTunes to share with Apple TV. But there doesn't seem to be any way to share a Lightroom slideshow. If you have laid to create a video file that would probably work. Apple TV is a little clunky in my opinion. Some things are a little more difficult to do now than they were a while back. I probably haven't provided you with much help, but just keep experimenting and I think you will figure it out.

  • Hi I would like to show a presentation written on my macbook air on my television what is the best way to connect the two ?

    Hi I would like to show a presentation written on my macbook air on my television what is the best way to connect the two ?

    Much depends on the available connectivity  of your television.
    If it has HDMI input available, all you will need is a minidisplayport to HDMI adapter, and an HDMI cable long enough to place the Mac in the desired proximity to the TV. The adapter is avaialble from the Apple Store online.
    Provided the HDMI input on the television supports sound, and the model of your MBA supports it as well, make suree that your adapter is also supportive of sound, otherwise you will need to run separate cabling from the headphone jack of the MBA to TV sound input or external speakers.
    This is a somewhat specific answer to a question without any requisite detail. You don't indicate the model or type of inputs on your TV, nor do you indicate the model/generation of MBA you have.

  • What is the best way to export a slideshow .I like to show my slideshows via appleTV on my TV

    What is the best way to export a slideshow.I like to view  the show trough AppleTV on my television.

    You don't really give us a lot of information to work with, and assume we know something about this mdeia player. The only way to get the slideshow to a media player is to export it from iPhoto. To where? Depends on the media player. Will iTunes work? Depends on the media player. Does the media player have a DVD drive? If so, then burning it to DVD with iDVD will work, but it will be standard def not HD.

  • A2109 - What is the best way to remove the cover that hides the MicroSD card

    Hello.
    I have tried to remove the cover that hides the MicroSD card with little success.  So that I don't destroy it, what is the best way you have found to remove it.  Thanks.

    hi ourtech,
    From the back, remove the two screws at the left and right side. For the bezel, try to use the plastic prying tool in this order:
    1. From volume key to the left (I/O ports)
    2. From volume key to power key
    3. From the side without screws to I/O
    4. From power key downwards
    Also, be careful when removing the plastic near the volume button to avoid breaking the bezel.
    Hope this helps.
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • What is the best way to read and manipulate large data in excel files and show them in Sharepoint

    Hi ,
    I have a large excel file that has 700,000 records in it. The excel file has a few columns that change every day.
    What is the best way to read the data form the excel file in fastest and most efficient way.
    2 nd Problem,
    I have one excel file that has many rows each row contain some data that has certain keywords.
    What I want is  to segregate the data of rows into respective sheets(tabs ) in the workbook.
    for example in rows have following data 
    1. Alfa
    2beta
    3 gama
    4beta
    5gama
    6gama
    7alfa
    in excel
    I want there to be 3 tabs now with each of the key words alfa beta and gamma.

    Hi,
    I don't really see any better options for SharePoint. SharePoint use other production called 'Office Web App' to allow users to view/edit Microsoft Office documents (word, excel etc.). But the web version of excel doesn't support that much records as well
    as there's size limitations (probably the default max size is 10MB).
    Regarding second problem, I think you need some custom solutions (like a SharePoint timer job/webpart ) to read and present data.
    However, if you can reduce the excel file records to something near 16k (which is supported rows in web version of excel) then you can use SharePoint Excel service to refresh data automatically in the excel file in SharePoint from some external sources.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • What is the best way to display a Interactive Report having 20 columns

    Hi,
    I am having a Interactive Report having many columns (around 20).
    What is the best way to display that report...by default we have to scroll it horizontally to see all the columns.
    I want to avoid Horizontally Scrolling.
    Thanks,
    Deepak

    Hello Deepak,
    You mean apart from using a smaller font size or a bigger monitor?
    You can think about combining / wrapping columns (so more data in one column).
    Or hide some less important data and show that only on demand.
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • What's the Best Way to Clear a DataGrid?

    What's the best way to clear out a datagrid and where should
    I put it in the code? The problem I am having is with data that is
    populated in the grid. When I leave the screen and come back to it
    (using the Accordion component), the data is still populated in the
    datagrid and I would like to have a clear screen when going back to
    it.
    So what I am looking for is the code to clear it (or
    removeAll()) and where would be the best place to execute it within
    the Accordion style setup.
    Thanks.
    Dave

    Use a collection for the dataProvider, and call removeAll();
    Call it on the hide, show or change events.
    Avoid raw Array an XMLList as dataProviders.
    Tracy

  • I have an old 30" apple cinema display (2005) I want to use as a 2nd monitor to a new iMac (2012).  I don't just want mirror image of iMac; what's the best way to do this?

    I have not bought the iMac yet but will do so very soon and just want to make sure I have what I need to get everything setup including adding the old faithful 2005 30" cinema display.  Currently I am driving the old 30" cinema display with a macbook pro also purchased 2005 and happy to say I got a lot of good miles out of this rig.  What's the best way to connect the old 30" monitor as a second display for the new generation iMacs?
    Other Questions
    I can find online new in unopened box a 2012 iMac 27" i7 with 1T Fusion Drive for $1899 no sales tax.  This seems like a pretty good deal since I notice the same is available from Apple refurbished for $100 more plus sales tax.  I know that they say the Fusion drive is a lot faster on 2013 models but some of the speed tests I reviewed online showed the 2012 i7 and 2013 i7 very close on speed for both storage and processing.  Any thoughts?
    I don't like changing batteries so I would buy a separate Apple keyboard with numeric pad since it only comes with wireless keyboard.  I'm a trackpad enthusiast having been using my macbook pro trackpad with current set up; and I am prepared to buy the Apple trackpad and replace batteries every 2 months but I would greatly prefer USB connection and rechargeable trackpact.  I know Logitech makes one so if anyone is using and knows how it compares to Apple's I'm all ears. 

    <http://support.apple.com/kb/HT5891>
    You can use USB for the Apple trackpad.
    <http://www.mobeetechnology.com/the-power-bar.html>

  • What is the best way to double buffer in this case and how to do it....

    currently I have
    public class Frame1 extends JFrame{
    //inside this class I call up circle class, rectangle class, etc.... to draw
    }I am making a "paint" program, and I have individual classes to handle the paint methods heres an example:
    abstract public class Shape {
        public Shape() {
        public abstract void draw(Graphics g, Color c, int x, int y, int width,int height);
    }and then....
    public class Circle extends Shape{
        public Circle() {
        public void draw(Graphics g, Color c, int oldx, int oldy, int newx, int newy) {
            g.setColor(c);
            g.drawOval(Math.min(oldx, newx), Math.min(oldy, newy), Math.abs(oldx - newx), Math.abs(oldy - newy));
    }There is also a Rectangle class, line class.... etc! So my question to you is the following... what is the best way to implement double buffer in the individual classes? And how to do it?? And also.... the drawings should be kept inside a jPanel.
    Any bit of help is much appreciated Thank you!!

    You don't need to do double-buffering. Swing
    components are double-buffered by default. Just make
    sure you override paintComponent() and not paint().
    And even if you had to, why would there be any
    difference in implementation for your classes whether
    they paint to on- or off-screen graphics?I need to override paintComponent()? what if I don't...
    I am using JBuilder2005 and they automate somethings for me. So thats how they did it when they created the application they did this....
    public class Frame1 extends JFrame{
    /*** all my code here***/
    public class Application1 {
        boolean packFrame = false;
         * Construct and show the application.
        public Application1() {
            Frame1 frame = new Frame1();
            // Validate frames that have preset sizes
            // Pack frames that have useful preferred size info, e.g. from their layout
            if (packFrame) {
                frame.pack();
            } else {
                frame.validate();
            // Center the window
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            Dimension frameSize = frame.getSize();
            if (frameSize.height > screenSize.height) {
                frameSize.height = screenSize.height;
            if (frameSize.width > screenSize.width) {
                frameSize.width = screenSize.width;
            frame.setLocation((screenSize.width - frameSize.width) / 2,
                              (screenSize.height - frameSize.height) / 2);
            frame.setVisible(true);
            try {
                jbInit();
            } catch (Exception ex) {
                ex.printStackTrace();
         * Application entry point.
         * @param args String[]
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    try {
                        UIManager.setLookAndFeel(UIManager.
                                                 getSystemLookAndFeelClassName());
                    } catch (Exception exception) {
                        exception.printStackTrace();
                    new Application1();
        private void jbInit() throws Exception {
    }

  • What is the best way to organize music by artist with various artist...

    What is the best way in iTunes 7 to organize my music by an artist who has several songs that have appearances by other artist? I now have about 400 Artist, in my artist list.
    1-Most of them are by the same Artist but with people who appear on their album as a special guest. What is the best solution for this?
    2-The same Artist appear on someone else's album what is the best solutions for this? I would like to have as few categories as possible.
    When I have a track with 2 artist, how will iTunes handle both Artist or do I have to determine? If I choose 1 Artist, does this mean that when I search for the 2nd Artist that the track would not be found. Please help me. I want to fix my Library so I can back it up.

    Do you mean the Artist and the Album
    Artist fields?
    There is the Artist field. This is for the
    artist(s) doing the song.
    There is the Album Artist field. This is for
    who's album it is.
    If there are featured artists on a song, I usually
    take them out of the Artist field and put it
    after the song title.
    "Smooth" - Santana featuring Rob Thomas becomes
    "Smooth featuring Rob Thomas" - Santana.
    This way I don't end up with a bunch of different
    artists showing up in the Artists column.
    That wwas exactly what I was talking about.

  • What is the best way of setting up Family Sharing?

    I just bought my son an iPad Mini and I am trying to decide on what is the best way of setting it up for him. The one thing I do know is that I do NOT want all the content that is my iPhone 6 to pop up on his iPad Mini. I want his iPad to be used for his games and educational stuff and his own music. I don't mind setting up a family photo album and share photos with the family. So is the Family Sharing option the best way of doing this based on what I just mentioned? Do I set him up with his own Apple ID? If so will everything still be based off my account so he won't have to create his own iTunes Library?
    I always use iTunes gift cards to purchase music and content. Will I be able to continue to use them even if I want to put some new content on his iPad and not my iPhone? Do I enter in his Apple ID info. Can you restrict certain family members to just certain things for example you only want to share photos with one person whereas you might want to share your music with another family member?
    Any suggestions on the best way of setting this up would great!
    Thanks!

    Hi DVX100Shooter,
    Congratulations on getting your son a new iPad, I am sure he will enjoy it. 
    Family Sharing is one way of managing both purchases and content between members of a related group of people. Each member must have their own Apple ID. You can choose what music you wish to share with the family from your own account. See this article -
    OS X Yosemite: Share purchases with your family
    In particular the section titled Hide a purchase from other family members
    The music library on your son's iPad is separate from yours, but under Family Sharing you agree to pay for all purchases made through the iTunes store. If you wish to control what is purchased you can set up the Ask to Buy option for any family member under adult age in your location. See this article for details -
    Request and make purchases with Ask to Buy - Apple Support
    Gift cards may not be used for billing of purchases under family sharing, with the exception that a family member may use gift cards to purchase their own content. See this article for information about Family Sharing billing policies -
    Family purchases and payments - Apple Support
    The shared family photo album is available to all family members.
    Family Sharing - Apple Support
    Thanks for using Apple Support Communities.
    Best,
    Brett L 

  • What's the best way to merge, restore or reconstruct iPhoto and Aperture libraries to resolve images that are not found/offline?

    Hey there, Apple Support Communities.
    To start, I'm working on a MBP Retina 15" with a 2.3GHz i7 processor and 16 GB of RAM.  10GB free on a 256GB SS HD.  Attached are two external HDs - one 1TB Western Digital portable drive from 2011, one 2TB Porsche LaCie non-portable drive from 2013; both connected via USB.  All photo libraries in question are on the external drives.
    I have Aperture 3.5.1 and iPhoto 9.5.1.  I prefer to work in Aperture.
    The Issue(s)
    Over the years, I have accumulated a number of iPhoto libraries and Aperture libraries.  At one point, I thought my WD drive was dying so I purchased the LaCie and copied all libraries over the the LaCie drive.  (Turns out, there's probably an issue with my USB port reading drives, because I can once again see the WD drive and occasionally I can't see the LaCie drive.)
    So now I have old version of some libraries on the WD drive, and new versions on the LaCie drive.
    When I was moving things, I ran the software Gemini to de-dupe my iPhoto libraries.  Not sure what effect that may have had on my issues.
    In my main Aperture library and in some iPhoto libraries, I get the image-not-found badge or exclamation point.  I've dug through the hidden Masters folders in various libraries to find the original image.  In some cases, I have been able to find the original image, sometimes in a different version of the iPhoto library.
    My Question(s)
    1.  For Aperture libraries that have missing originals, is there some magical way to find them, or have they just disappeared into the oblivion?
    2.  For iPhoto libraries that have missing originals and I have found the original in another iPhoto library, what is the best way to proceed?
    3.  Are there quirks to merging iPhoto and Aperture libraries (by using the Import->Library) feature that I should be aware of?
    TL;DR: Too many iPhoto and Aperture libraries, and not all the original pictures can be found by the libraries anymore, though some originals still do exist in other libraries.  Steps/process to fix?
    Thank you!  Let me know if you need add'l info to offer advice.
    With appreciation,
    Christie

    That will not be an easy task, Christie.
    I am afraid, your cleaning session with Gemini may have actually removed originals. I have never used this duplicate finder tool, but other posters here reported problems. Gemini seems to replace duplicate original files in photo libraries by links, and this way, deleting images can cause the references for other images to break. And Aperture does not follow symbolic links - at least, I could never get it to find original files this way, when I experimented with this.
    1.  For Aperture libraries that have missing originals, is there some magical way to find them, or have they just disappeared into the oblivion?
    You have to find the originals yourself. If you can find them or restore them from a backup, Aperture can reconnect them. The reconnect panel can show you, where the originals are supposed to be, so youcan see the filename and make a Spotlight search.
    For iPhoto libraries that have missing originals and I have found the original in another iPhoto library, what is the best way to proceed?
    Make a copy of the missing original you found in a folder outside the iPhoto library. You can either open the iPhoto library in Aperture and use "File > Locate Referenced file" to reconnect the originals, or simply reimport them. Then Lift&Stamp all adjustments and metadata to the reimported version.
    See this manual page on how to reconnect originals:  Aperture 3 User Manual: Working with Referenced Images  (the paragraph:  Reconnecting Missing or Offline Referenced Images)
    Are there quirks to merging iPhoto and Aperture libraries (by using the Import->Library) feature that I should be aware of?
    References images will stay referenced, managed will remain managed. You need to unhide all hidden photos in iPhoto - this cannot be done in Aperture.
    and not all the original pictures can be found by the libraries anymore, though some originals still do exist in other libraries.  Steps/process to fix?
    That is probably due to Gemini's replacing duplicate originals by links, and your best cause of action is to fix this before merging the libraries. Reconnecting can be done for your iPhoto libraries in Aperture.

Maybe you are looking for

  • How to calculate for diffrent time zones

    I have a simple clock that shows the current time using the get.Time command. My problem is this. I'm in the central time zone. So to calculate Pacific time I subtract 2 hours from hours like so "hours = mydate.getHours() - 2 ;" So if it is 2pm centr

  • Hidden layers get PDFed anyway

    Hello all, I've been meaning to ask this for a while now: Whenever I hide InDesign layers; then Export to a PDF; and choose Visible Layers (in the General options); and finish up and OK the producing of the PDF; the dialog immediately warns me that s

  • Can't update the system due to unresolved dependencies-nvidia-bumblebe

    resolving dependencies... looking for inter-conflicts... error: failed to prepare transaction (could not satisfy dependencies) :: nvidia-bumblebee: requires linux<3.8 Desktop: KDE 4.10.1 Kernel: 3.7.10-1-ARCH x86_64 (64 bit) nvidia-bumblebee: 313.18-

  • Email notification on missing parts

    Hi All,        Is it possible can we set a automatic E-mail notification to the MRP controller at the time of material shortage for a production order in SAP. If its please provide me step by step instructions. Thanks in Advance.

  • Oracle Order Management Order Close Problem

    Hi all, Every last day of month workflow automatically closes the orders which all lines are closed. But I want to control closing order. When closing order i want to check some values, and decide to close order or keep booked(unclosed). Is there any