Jump to content

Delete row from a tabular report based on the result of a calculated field


Recommended Posts

Hello,

I saw this How-to article on changing the background of a row based on the value of a field:

http://howto.caspio.com/tech-tips-and-articles/advanced-customizations/how-to-dynamically-change-the-background-of-a-results-page/ 

However, I need to delete the row instead of changing its background color. Also, I need to delete the row when a calculation returns a blank value.

Is this possible? I don't know how to write JavaScript code.

 

Link to comment
Share on other sites

Hi dspolyglot,

You can try creating an HTML block and put this template code:

<div id="row-marker-[@field:ID_FIELD_NAME]"></div>
<script>
    var marker = document.getElementById('row-marker-[@field:ID_FIELD_NAME]');
    var column = marker.parentNode;

    if ('[@calcfield:1]' === '')
    {
        var row = column.parentNode;
        row.parentNode.removeChild(row);
    }
</script>

Please replace ID_FIELD_NAME with the actual name of your ID/AutoNumber field. Also, don't forget to replace [@calcfield:1] with the actual calculated field you're using.

Hope this helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...