Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Check row for data in a dynamic table

ksumwalt
Level 3
Level 3

Is there a way, without checking every cell in a row, to determine if at least one of the cells in that row contains some sort of data?  My goal is to have a Delete This Row button in the first cell, but provide a warning message if the row contains data.  Since I have a form with 8 tables that contain this button, I was hoping to find somehting like this.parent.parent._Row.hasData but that doesn't seem to exist.  I am jus thoping there is something I missed.

Regards,

Karl

1 Reply
Niall_O_Donovan
Level 10
Level 10

Hi,

I think that you will need to loop through the objects in the row to test if they contain data or not.

var oNodes = this.parent.nodes;

var nCheck = 0;

for (var i=0; i<oNodes.length; i++) {

     if (oNodes.item(i).rawValue !== null) {

          nCheck = 1;

     }

}

if (nCheck != 0) {

     // warn user

}

Niall