Scripting Row Shading

I am using a table where I have Apply Alternate Row Shading checked. When a row is deleted by clicking on a delete row button the shading doesn't adjust and the user may end up with two rows with the same shade colour adjacent to each other. Is there a way to get the shading to update with a script when the delete row button is clicked?

[email protected] wrote:
> I am using a table where I have Apply Alternate Row Shading checked. When a row is deleted by clicking on a delete row button the shading doesn't adjust and the user may end up with two rows with the same shade colour adjacent to each other. Is there a way to get the shading to update with a script when the delete row button is clicked?
The javascript code for the row shading is on the initialize method for each row. This code is
auto-generated by the table wizard. Because it's defined on the initialize method, the row color is
only updated when the row is first created. Move the code from the initialize event to the
layout:ready event and it will update each time your form layout changes.
In my opinion, Adobe's choice to use the initialize event was a poor one.
Justin Klei
Cardinal Solutions Group
www.cardinalsolutions.com

Similar Messages

  • Alternate Row Shading in Summary Reports

    I know how to get alternate row shading in the Detail section of a report.  What I need to know, is in a summary report, where the detail section is suppressed and the Group Footer section is acting as your detail section, how does one apply alternate row shading to that?  My usual method isn't working.
    Thanks!

    What are you trying?  Something like
    If GroupNumber mod 2 = 1 then
        crSilver
    Else
        crWhite
    The Panda

  • Alternate Row Shading

    Periodically my row shading goes away. If I go to Inspector and check alternating row color, I get shading, but its not every other line straight across. Some columns are shaded some not and not necessarily alternating lines. My desire is to have every other line shaded straight across to make it easier to read, similarly to if some laid a straight edge on a printed copy so they didn't slip down a line. Input?
    Thanks

    I agree with the fact that it make sense.
    In fact I build the table to check that my understanding of the feature was correct.
    At this time, we have a possible explanation of what the OP describe but maybe an other feature is at work.
    Moet Hennessy (my customized version of Wait And See)
    Yvan KOENIG (VALLAURIS, France) jeudi 23 février 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.3
    My Box account  is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

  • Header row shading

    Hi All,
    i have a table with 2 columns(It has a header row and a body row, the body rows increase or decrease based on the data in XML , and the header rows repeat for each page).
    I have shaded the header rows by using java script as follows
    form1.S5.Table1.HeaderRow.S5_HEADER_BENEFITS.fillColor = "212,212,212";
    the issue is when the header row repeats in the next page due to oveflow the shade has been missing from the header rows.
    How do i make the shading appear whenever the header  row appears on next page due to oveflow.
    Thanks in advance
    De1209.

    Does this have to be done in script? Select either the header row or the column in the header that you want shaded and use the Background Fill section of the Border tab to set the fill color.  It should carry through on all pages.

  • Alternate Row Shading or Formatting

    Hello,
    I have a report in which I want to shade the backgroud color for alternate rows.  More specifically, I'm trying to do this for a group footer (the details are suppressed and the group footer is the most detailed level displayed).  When I do this, not every other line is shaded.  Sometimes it is three in a row, sometimes once, etc.  I'm assuming this is because groups with a $0 value are suppressed.  This is the formula I'm using:  
    if (recordnumber mod 2) > 0 then Color (238,238,238) else crwhite
    Any suggestions would be greatly appreciated.
    Thanks,
    Dan

    Try this
    //Place this formula in the  group header/footer section that you with to be shaded and only in that group
    Whileprintingrecords;
    global numbervar shading;
    shading := shading + 1
    ///place the following formula in the section expert for group footer/header you wish to shade
    Whileprintingrecords;
    global numbervar shading;
    if remainder(shading,2)=1 then Color (238,238,238) else crwhite

  • A script - row number

    I need a cf script that finds out the total row count of a
    sql database...Any idea?
    The reason I need is to compare our current db (on SQL05)
    with the new one that will be attached to the SQL 05....

    I have found a stored procedure that does what I need...
    thank you all
    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    go
    ALTER PROCEDURE [dbo].[listTableRowCounts]
    AS
    BEGIN
    SET NOCOUNT ON
    DECLARE @SQL VARCHAR(255)
    SET @SQL = 'DBCC UPDATEUSAGE (' + DB_NAME() + ')'
    EXEC(@SQL)
    CREATE TABLE #foo
    tablename VARCHAR(255),
    rc INT
    INSERT #foo
    EXEC sp_msForEachTable
    'SELECT PARSENAME(''?'', 1),
    COUNT(*) FROM ?'
    SELECT tablename, rc
    FROM #foo
    ORDER BY tablename,rc ASC
    DROP TABLE #foo
    END

  • Alternate row shading in tables

    Hi all
    I've been trying again and again to get alternate rows of my long table in Frame 11 to be shaded.
    I succeeded, then did something to remove them, and now I CANNOT get them to reapply.
    I am using the Table Designer, Shading tab.
    The Heading and Footing Shading works fine, it changes as I change colour or fill.
    But the Body Shading refuses to.
    Have set Body shading to Shade by Body Rows
    First : 1
    Fill 3%
    Color: Secondary Blue
    Next 1
    Fill: None   
    Colour White
    When I apply, nothing seems to change. I have the whole table highlighted.
    The Custom Ruling and Shading dialog works fine but this is a long table and I don't want to go down that route. Though given the amount of time I've spent on this I probably could have done it twice over...
    Can anyone help please? It feels like a FM bug but it could just be something I'm doing wrong.
    Thanks
    Laura

    To understand what your table tag is doing, create a blank table using that table tag.
    Once you've got the settings of that table squared away, apply to your existing table.
    If you still have problems, then you have custom ruling and shading applied (which I strongly recommend against, along with other format overrides). Use Error's method for removing the overrides, but examine your choices carefully; the custom ruling and shading box is particularly confusing.
    -Matt 
    Matt Sullivan
    roundpeg, Inc. contractor
    @mattrsullivan
    P: 714 798-7596 | F: 360.230.7269 | [email protected]

  • FR - Need to add row shading on every Nth row

    My client has a report where they want to add shading to the rows on every Nth row. The rows have member selections such as Children of or Descendents of, so there are varying number of report rows produced.
    I've played with using a formula column and using the Rank and Mod functions to rank the sorted column and on every 3rd row (when Mod 3 = 0) have the shading applied, when it is not 0 no shading. This works to a point and this is where I am stuck. When values in the rank are the same, the shading skips such as if the value in the sorted column is missing or zero.
    Any other thoughts???
    Rob

    Hi Rob
    It sounds like you are really close, that is probably the way I would attempt it. Have a look in the user guide at the rank function syntax and I'm pretty certain there is are optional fields so that non-numeric values (e.g. #Missing) are given a rank and a keyword that tells HFR whether you want all records to have unique ranks, syntax is something like:
    Rank([A,1:10].ifNN(-1), descending, true)
    Where the ifNN(-1) tells HFR to assign a value of -1 to all non-numeric values and the true at the end tells it you wany unique ranks.
    Hope this helps
    Stuart

  • Shaded rows in table control object.

    Hi. I've got a question.
    I've got a table control object. When I fill it with data I set all rows shaded (screen-input = 0). But now the problem is that when I want to mark some row / rows (by pressing rectangle at the left side of table object) the line doesn't match
    Could You tell me what should I set more?

    hi,
    what is the command u use for selecting the line?
    is it <ur tabcntrl>-currentline = some variable.
    regards,
    Renjith Michael.

  • Show shaded rows in Finder

    After a recent update (it might have been to Mountain Lion 10.8.3 last week, I'm not sure), Finder came up and it had alternately shaded rows (shaded, then not shaded, then shaded, then not shaded and so on).  It reminded me of the old computer green-bar paper.  I liked the look of that as it help distinguish rows when I had Finder in full screen and was showing a long list.  The next day I went into Finder and the rows were no longer shaded.  All rows were clear/white.  I miss what I had and have been unable to find a way to turn that feature back on.  Any ideas?

    In iPhoto I was able to right-click on single picture or even on an event to show the images in Finder.
    Now I see this option in the File menu of Photos, but it's greyed out. Why?
    You can only reveal original image files in the Finder, that have been imported as referenced . Files stored inside the Photos Library cannot be revealed in the Finder.
    See this Help Page:   https://help.apple.com/photos/mac/1.0/?lang=en#/pht1ed9b966d
    Store imported files outside the Photos library
    Choose Photos > Preferences, then click General.
    Deselect the “Copy items to the Photos library” checkbox.Now, when you import photos or video, Photos leaves the files in their original location and accesses them as referenced files.
    Copy referenced files into a Photos library
    You can copy referenced files into your photo library so they’re easier to back up and are automatically included in your iCloud Photo Library.
    Select the files that you want to move into the photo library.
    Choose File > Consolidate.
    Click Copy.

  • Get default row fillColor value

    Hello,
    Sorry for my english it's not my native language.
    The problem i have is that i am using a table that grow each time a row is filled in.
    When some value's are chosen in a dropdownlist the backgroundcolor has to change in red.
    This part is working good already.
    The problem is that the table has alternating row shading.
    So when the specified values are chosen the color changes to red.
    But when the form filler chose another value the color stays red.
    Now i want to get the default fillColor value as a variable and use it for the else color.
    So the variable = the default background color of the alternathing row.
    This i the code i got already:
    form1.InventarisKoelinstallaties.Subform4.Table1.Row1.Cell8::change - (JavaScript, client)
    var RowDefaultColor = Row1.fillColor();
    if (xfa.event.newText == "R22"){
    Row1.fillColor = "255,0,0";
    else if (xfa.event.newText == "R12"){
    Row1.fillColor = "255,0,0";
    else if (xfa.event.newText == "R409a"){
    Row1.fillColor = "255,0,0";
    else if (xfa.event.newText == "R408a"){
    Row1.fillColor = "255,0,0";
    else{
    Row1.fillColor = "RowDefaultColor";
    I hope someone can help me.

    What you want to do is access the template object (as it exists in Designer) of your subform. Here's a function I found awhile back that John Brinkman wrote:
    function findTemplateField(vField)
    var vSOM = vField.somExpression.replace(/\[[0-9]*\]\./g, ".");
    vSOM = vSOM.replace(/xfa\.form/, "$template");
    return xfa.resolveNode(vSOM);
    Put that any where in your change event or even reference it through a script object, your choice.
    Edit the final else line in your code to:
    Row1.fillColor=findTemplateField(Row1).fillColor;
    Kyle

  • Add new row error in Adobe Reader

    Hi
    I have created a form in livecycle and when the form is tested in adobe professional 8 it adds rows correctly however when test in reader i get the following error.
    When you ok, it adds the row, but appears every time ‘Add Row’ is clicked.  Also moves all the rows over to the next page and when it gets to bottom of that page moves it all onto next page, leaving page 2 blank.  Also, doesn’t move onto page 4 when adding more rows.
    Anybody have any ideas?

    Hi Niall
    It's me again
    Thanks for you instructions but I now have different issues since turning off the Row Shading.
    This message with a different line number first happens when the form is opened, when you say ok and then try to add a new row it happens again, it then lets you add a row and as soon it gets to the bottom of the page all the rows plus the headings move from the first page on to page 2. I think it is due to the allow page breaks within content box not being ticked in image 2, do you know how I can get this box active?
    Regards
    Graham

  • How Get Alternating Row Colors To Work?

    I've searched this forum, searched online, and followed the directions in the Numbers 3.0 Help, but I just can't get the Alternating Row Colors function to work.  I'm using an iMac and a new Mac Mini, both running Mavericks, on a spreadsheet converted from Numbers '08.  I've seen several screenshots of tables in discussions on this forum that seem to have Alternate Row shading; presumably they were done with Numbers 3.0. So apparently, it can be done.  Need Help!

    Vistan wrote:
    Now I see it!  I did not have any of the Table Style boxes in the upper right cortner of the creen selected...when I choose one, the alternate row colors sudenly pop up.  I'm now experimenting with the Grid Lines and Header &Footer selection buttons.
    Vistan
    Vistan,
    I'm about as sure as I can be that Table Style boxes having being clicked has nothing to do with the Checkbox for Alternating color rows. I've been wrong before, but I can't grasp the logic on this one, and it doesn't happen here the way you describe.
    Jerry

  • Printing button in PDF fillable form.

    Dear All,
    I have created a PDF fillable form with a button which save & print the pdf.
    The code for is as fallow:
    Formular1.#pageSet[0].Seite1.Bildfeld1::click - (JavaScript, client)
    var Mailto = "[email protected]";
    var Betreff = Textfeld1.rawValue;
    var Nachricht = "Dies ist eine Telefonnotiz\r2.Zeile Hier";
    var CC = "[email protected]";
    var BCC = "[email protected]";
    var Mail = "mailto:" + Mailto + "?Subject=" + Betreff + "&Body=" + Nachricht + "&cc=" + CC + "&bcc=" + BCC;
    event.target.submitForm({
    cURL: Mail,
    bEmpty: false,
    cSubmitAs: "PDF"
    event.target.closeDoc(true); (FormClac)
    Formular1.#pageSet[0].Seite1.DruckenSchaltfläche1::click - (JavaScript, client)
    xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);
    my problem now is that with this script I can print and save the file even though all required fields are not filled!! I donot anyone to have the possibility to print the file or save it unless he fill all required fileds.
    Any Idea, coz Iam new in the Adobe Livecycle world

    I donot want to ask silly questions , but really I canot find the XML source code. all what I can find is this:
    Formular1.#pageSet[0].Seite1.Bildfeld1::click - (JavaScript, client)
    var Mailto = "[email protected]";
    var Betreff = Textfeld1.rawValue;
    var Nachricht = "Dies ist eine Telefonnotiz\r2.Zeile Hier";
    var CC = "[email protected]";
    var BCC = "[email protected]";
    var Mail = "mailto:" + Mailto + "?Subject=" + Betreff + "&Body=" + Nachricht + "&cc=" + CC + "&bcc=" + BCC;
    event.target.submitForm({
    cURL: Mail,
    bEmpty: true,
    cSubmitAs: "PDF"
    Formular1.#pageSet[0].Seite1.DruckenSchaltfläche1::click - (JavaScript, client)
    xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);
    Formular1.#subform[1].#subform[2].Tabelle3.Zeile1.#subform[1].#subform[2].Teilformularsch altfläche1entfernen::click - (JavaScript, client)
       This button will Remove the current instance of the repeating subform or table row.
       bCalc: Flag - true if the removed instance might be referenced by other calculations, otherwise false.
       message: The error message displayed.
    var bCalc = true;
    var message = "Sie haben die Mindestanzahl zulässiger Objekte erreicht.";
    // DO NOT MODIFY THE CODE BEYOND THIS POINT - 9.0.0.2.20101008.1.725030.725025 - Subform_Instance_Controls_IRM.xfo.p4
    var oWrapper = this.parent.parent;          // The outer subform built in to the object, enclosing the button group.
    var oTargetSubform = oWrapper.parent;          // The subform or table row the controls are intended to manipulate.
    var oManager = oTargetSubform.instanceManager;          // Get the instance manager.
    var nMinCount = oManager.occur.min;                              // Get the minimum number of subform occurrences allowed.
    var nSubCount = oManager.count;                                        // Get the current number of instances.
    // Proceed if the minimum number of subform occurrences has not been reached.
    if (nSubCount > nMinCount) {
              // Invoke the Instance Manager.
              oManager.removeInstance(oTargetSubform.index);
              // Fire the form calculations.
              if (bCalc == true) {
              // Execute all the form calculations.
              xfa.form.recalculate(1);
    } else {
              xfa.host.messageBox(message,"Remove Item", 3);
    // END OF DO NOT MODIFY
    Formular1.#subform[1].#subform[2].Tabelle3.Zeile1.#subform[1].#subform[2].Teilformularsch altfläche1hinzufügen::click - (JavaScript, client)
       This button will insert one instance of the repeating subform or table row.
       bCalc: Flag - true if the new instance might be referenced by other calculations, otherwise false.
       message: The error message displayed.
    var bCalc = true;
    var message = "Sie haben die maximale Anzahl zulässiger Objekte erreicht.";
    // DO NOT MODIFY THE CODE BEYOND THIS POINT - 9.0.0.2.20101008.1.725030.725025 - Subform_Instance_Controls_IRM.xfo.p2
    var oWrapper = this.parent.parent;          // The outer subform built in to the object, enclosing the button group.
    var oTargetSubform = oWrapper.parent;          // The subform or table row the controls are intended to manipulate.
    var oManager = oTargetSubform.instanceManager; // Get the instance manager.
    var nMaxCount = oManager.occur.max;                     // Get the maximum number of subform occurrences allowed.
    var nSubCount = oManager.count;                              // Get the current number of instances.
    // Proceed if the maximum number of subform occurrences has not been reached.
    if ((nMaxCount == "-1") || (nSubCount < nMaxCount)) {
              // Invoke the Instance Manager.
              var oNewInstance = oManager.addInstance(1);
              // Fire the form calculations.
              if (bCalc == true) {
              // Execute all the form calculations.
              xfa.form.recalculate(1);
              // Move the new subform below the current one.
              var nIndexFrom = oNewInstance.index;
              var nIndexTo = oTargetSubform.index + 1;
              oManager.moveInstance(nIndexFrom, nIndexTo);
    } else {
              xfa.host.messageBox(message,"Insert Item", 3);
    // END OF DO NOT MODIFY
    Formular1.#subform[1].#subform[2].Tabelle3.Zeile1.#subform[1].#subform[2].Teilformularsch altflächeNachOben1::click - (JavaScript, client)
       This button will move the current instance of the repeating subform or table row up one position.
       bCalc: Flag - true if the moved instance might be referenced by other calculations, otherwise false.
       message: The error message displayed.
    var bCalc = true;
    var message = "Das aktuelle Objekt kann nicht nach oben verschoben werden, da es sich bereits an erster Stelle befindet.";
    // DO NOT MODIFY THE CODE BEYOND THIS POINT - 9.0.0.2.20101008.1.725030.725025 - Subform_Instance_Controls_IRM.xfo.p1
    var oWrapper = this.parent.parent;          // The outer subform built in to the object, enclosing the button group.
    var oTargetSubform = oWrapper.parent;          // The subform or table row the controls are intended to manipulate.
    var nIndex = oTargetSubform.index                    // Get the index number of the current subform or table row.
    var oManager = oTargetSubform.instanceManager;          // Get the instance manager.
    // Proceed if the current subform is not the first instance.
    if (nIndex != 0) {
              // Move the current subform.
              var nIndexFrom = nIndex;
              var nIndexTo = nIndex - 1;
              oManager.moveInstance(nIndexFrom, nIndexTo);
              // Fire the form calculations.
              if (bCalc == true) {
              // Execute all the form calculations.
              xfa.form.recalculate(1);
    } else {
              xfa.host.messageBox(message,"Move Item", 3);
    // END OF DO NOT MODIFY
    Formular1.#subform[1].#subform[2].Tabelle3.Zeile1.#subform[1].#subform[2].Teilformularsch altflächeNachUnten1::click - (JavaScript, client)
       This button will move the current instance of the repeating subform or table row down one position.
       bCalc: Flag - true if the moved instance might be referenced by other calculations, otherwise false.
       message: The error message displayed.
    var bCalc = true;
    var message = "Das aktuelle Objekt kann nicht nach unten verschoben werden, da es sich bereits an letzter Stelle befindet.";
    // DO NOT MODIFY THE CODE BEYOND THIS POINT - 9.0.0.2.20101008.1.725030.725025 - Subform_Instance_Controls_IRM.xfo.p3
    var oWrapper = this.parent.parent;          // The outer subform built in to the object, enclosing the button group.
    var oTargetSubform = oWrapper.parent;          // The subform or table row the controls are intended to manipulate.
    var oManager = oTargetSubform.instanceManager;          // Get the instance manager.
    var nSubCount = oManager.count;                              // Get the current number of instances.
    var nIndex = oTargetSubform.index                    // Get the index number of the current subform or table row.
    // Proceed if the current subform is not the last instance.
    if ((nIndex + 1) < nSubCount)  {
              // Move the current subform.
              var nIndexFrom = nIndex;
              var nIndexTo = nIndex + 1;
              oManager.moveInstance(nIndexFrom, nIndexTo);
              // Fire the form calculations.
              if (bCalc == true) {
              // Execute all the form calculations.
              xfa.form.recalculate(1);
    } else {
              xfa.host.messageBox(message,"Move Item", 3);
    // END OF DO NOT MODIFY
    Formular1.#subform[1].#subform[2].Tabelle3.Zeile1::indexChange - (JavaScript, both)
    //{{Adobe LiveCycle Designer Generated Code Begin}} - row shading script. Don't modify it!
    var Freqs=[1,1];
    var Colors=["255,255,255","255,255,255"];
    var nFreqSize = 0;
    for (var i=0; i<Freqs.length; i++)
      nFreqSize += Freqs[i];
    var nRelIndex = this.index % nFreqSize + 1;
    for (var nRun=0; nRun<Freqs.length; nRun++)
       if (nRelIndex>Freqs[nRun])
            nRelIndex -= Freqs[nRun];
       else
          this.border.fill.color.value = Colors[nRun];
          break;
    //{{Adobe LiveCycle Designer Generated Code End}} - row shading script.
    Formular1.TABELLEN1.#subform[2].Tabelle4.Zeile1::indexChange - (JavaScript, both)
    //{{Adobe LiveCycle Designer Generated Code Begin}} - row shading script. Don't modify it!
    var Freqs=[1,1];
    var Colors=["255,255,255","255,255,255"];
    var nFreqSize = 0;
    for (var i=0; i<Freqs.length; i++)
      nFreqSize += Freqs[i];
    var nRelIndex = this.index % nFreqSize + 1;
    for (var nRun=0; nRun<Freqs.length; nRun++)
       if (nRelIndex>Freqs[nRun])
            nRelIndex -= Freqs[nRun];
       else
          this.border.fill.color.value = Colors[nRun];
          break;
    //{{Adobe LiveCycle Designer Generated Code End}} - row shading script.

  • ADD Auto Generate column to table

    Hi All,
    I drag my table from dataview , what I want is add new column to it ? I have tried but i couldnt , and add script to that column so
    it come auto generate int numbers?
    thanks

    Hi,
    try to create a new table with the wizard, under the toolbar -> table -> insert table -> create table using assistant.
    Set the body layout, with fixed dimensions or depending or data.
    Then choose if you need a footer and a header.
    Divide the new table in sections if needed.
    Optionally, you even can add row shading to the table.
    Finally, you need to create the correspoding binding between the context and the new created table.
    I hope this solves your problem.

Maybe you are looking for