If I understand your question correctly the following script would give you the row value: var rowNum = [object reference].instanceManager.index; Remember...[object reference] needs to be changed to whatever you have called your form/page/table/row. Also the index value is modal (i.e. 0,1,2,3, etc.) so if you want to use this in some type of row numbering scheme you will need to add 1 to the value...so that row "1" will be row 1 instead of "0".
Hello Nathan, I've watched almost all your videos and just like to say your tutorials are awesome. In almost all your expanding tables videos you add the + and - buttons in the first cell of row 1 and im wondering if there is a way to add a row between existing rows as whenever you hit the + button the new row is always added at the bottom of the table above the footer but what about between 2 rows. Also, is there a way to clear the data of a row without deleting the row? Please and thank you!
Hi Nathan, Just attempt what you have exactly in the tutorial above and got this error message when clicking on the check boxes. Im using ES 8.2. Any ideas? Script failed (language is formcalc; context is xfa[0].form1[0].Main[0].Checkbox[0]) script=SO.addToTable(this.parent.Table1, this.resolveNode("caption.value.#text").value, this.rawValue); Error: script does not have a method 'addToTable'
Looks like your using formcalc. All my videos and examples are written in/for JavaScript. Goto the script editor and in the top right dropdown change your script language from FormCalc to JavaScript. Then the sample code should work.
This is almost perfect for a project I'm working on - I just needed to change the check box for a Y/N/NA dropdown list (item values = 1,0,0). So in the SO I changed 'check_uncheck' for 'choice_rawValue' (don't know whether that was technically correct but it works). However, for both versions, if a value is entered and then removed/unchecked the initial value doesn't clear from the first row. I can work around this by adding a reset button or simply removing the body row min count, but is there a way to clear this whilst keeping the initial table row? Some kind of null test maybe? By the way, there was a syntax problem with the (") used in the SO script I copied. I think it must have been some kind of regional/locale issue perhaps? When the script was copied the inverted commas were 'angled', so the problem didn't clear until these were overwritten with straight vertical inverted commas. Weird.
addInstance() always adds at the end. However, there is another function - insertInstance() that does what you are wanting. You will need to enter an integer as a parameter for where the instance will be inserted.
True Tech Troubleshooting Now I have a nested subform.. parent is binded with items of table and child is a positioned subform just to hold fields at positions. Now I created addinstance for data subform and try to move it to specific index.but moveinstance is not working
Thanks for your clear examples. I'll be sharing what I have created from your tutorial soon.
Thanks for the tutorial!
If I understand your question correctly the following script would give you the row value:
var rowNum = [object reference].instanceManager.index;
Remember...[object reference] needs to be changed to whatever you have called your form/page/table/row. Also the index value is modal (i.e. 0,1,2,3, etc.) so if you want to use this in some type of row numbering scheme you will need to add 1 to the value...so that row "1" will be row 1 instead of "0".
Hello Nathan,
I've watched almost all your videos and just like to say your tutorials are awesome.
In almost all your expanding tables videos you add the + and - buttons in the first cell of row 1 and im wondering if there is a way to add a row between existing rows as whenever you hit the + button the new row is always added at the bottom of the table above the footer but what about between 2 rows. Also, is there a way to clear the data of a row without deleting the row? Please and thank you!
+Ian Piner insertInstance() instead os addInstance() will do that.
Hi Nathan,
Just attempt what you have exactly in the tutorial above and got this error message when clicking on the check boxes. Im using ES 8.2. Any ideas?
Script failed (language is formcalc; context is
xfa[0].form1[0].Main[0].Checkbox[0])
script=SO.addToTable(this.parent.Table1,
this.resolveNode("caption.value.#text").value, this.rawValue);
Error: script does not have a method 'addToTable'
Looks like your using formcalc. All my videos and examples are written in/for JavaScript. Goto the script editor and in the top right dropdown change your script language from FormCalc to JavaScript. Then the sample code should work.
This is almost perfect for a project I'm working on - I just needed to change the check box for a Y/N/NA dropdown list (item values = 1,0,0). So in the SO I changed 'check_uncheck' for 'choice_rawValue' (don't know whether that was technically correct but it works). However, for both versions, if a value is entered and then removed/unchecked the initial value doesn't clear from the first row. I can work around this by adding a reset button or simply removing the body row min count, but is there a way to clear this whilst keeping the initial table row? Some kind of null test maybe?
By the way, there was a syntax problem with the (") used in the SO script I copied. I think it must have been some kind of regional/locale issue perhaps? When the script was copied the inverted commas were 'angled', so the problem didn't clear until these were overwritten with straight vertical inverted commas. Weird.
Why does it need to be component."_"row1 rather than just component.row1 on line 9?
hi .. can we use component.Row1.instanceManager.addInstance(); to add instance at particular index? or it is always at end?
addInstance() always adds at the end. However, there is another function - insertInstance() that does what you are wanting. You will need to enter an integer as a parameter for where the instance will be inserted.
True Tech Troubleshooting Now I have a nested subform.. parent is binded with items of table and child is a positioned subform just to hold fields at positions. Now I created addinstance for data subform and try to move it to specific index.but moveinstance is not working