Expand my Community achievements bar.

Check row for data in a dynamic table

Avatar

Former Community Member

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

Avatar

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