I would like to have a drop-down list that is pre-populated with number determine the number if rows that are in a table. Does anybody have an example they could show me?
Thanks,
Paul
Views
Replies
Total Likes
Hello Paul,
What's the structure of the table? Is a static one or you are adding rows dynamically?
Lets say it is a static one and the Row numbers are Row1, Row2, Row3 etc. You can write a script to count the number of the rows and in the initialize event of the DropDown you can put the value.
var thisElement ;
var nodeLength = Table1.nodes.length; // Counts the total nodes present in the table.
var rowCount = 0;
for (var i=0; i<nodeLength; i++) { // Loops through the number of rows
thisElement = Table1.nodes.item(i) ;
if (thisElement.className == "subform") { // As every row is a subform it searches the term row, if found it increments the row count.
if(thisElement.name.indexOf("Row") != -1 ){
rowCount ++;
}
}
}
In the DropDown initialize event = this.rawValue = rowCount;
If the table is dynamic and lets say you are adding the instance of Row1.
then var rowCount = Table1.Row1.instanceManager.count;
Here in the click event of adding button you can put the above script.
Thanks,
Bibhu.
Views
Replies
Total Likes
What I actually want to do is have the number of rows change depending on the number selected from the dropdown list.
Views
Replies
Total Likes
Then in that case you can use the setInsance method to set the no.of rows.
Views
Replies
Total Likes
Can you elaborate on this. What would be the syntax of this command.
Views
Replies
Total Likes
var a; // set the variable depending upoen your need.
form1.Table1.Row1.instanceManager.setInstances(a);
Thanks,
Bibhu.
Views
Replies
Total Likes
If I use the value zero it does not work. How would I remove all the row instances if the value is zero.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies