on 06-20-2010 12:42 PM
Hi ,
I have a requirement, where i have a dynamic table on the form which has 2 buttons : Add row /delete row.
I have 2 queries :
1. I do not want to have Add /Delete buttons on each row, is there any way to do it ? I have gone through couple of threads, but it did nt get the exact way to do it.
2. I am thinking of a checkbox where i can select add/delete row . Once I add the row and then select the row, I fill up the values. .
As i m not able to retrieve the current row index on selecting the checkbox , please let me know the java script , i tried a couple of things.. not really working .
Please let me know , any help would be highly appreciated.
Thanks,
Saujanya
Hi,
Suppose the Form Hierarchy is:
BP
SubForm_Table
Btn_Add
Table
Row1
Btn_Delete
Now on the click event of the Btn_Add, add the JavaScript
this.parent.Table.Row1.instanceManager.addInstance();
And on Click of Btn_Delete, write:
this.parent.instanceManager.removeInstance( this.parent.index );
Hope this helps.
Regards,
Amit Rai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
let me add few important details:
- to add a row the table subform must have content flowed (to tell the system where to add the row)
- to be able to add a row, there must be a template row available, so you need (tab binding):
--- repeat for each data item (to repeat)
--- min count one (to have the template)
- to ensure it will work any time, you must always keep at least one row (so do not delete the last one)
- make sure your form is dynamic/ interactive or no change of the generated form will be possible
- rest do as mentioned above
Regards Otto
Hi,
Thanks alot for your replies. Actually the above script didnt really work for me.
Can you please let me know the how to find the current row in a table in javascript .
I tried this : this .parent.parent.instancemanager.instanceindex.. bt it didnt work for me . Any thoughts if anything else.
Thanks,
Saujanya
Issue resolved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
The issue is resolved. Thanks alot for all your replies. Solution is below :
subform1
Add row btn
subform 2
Delete row btn , fields in row.
Add row :
newSubform = newMainSubform.instanceManager.addInstance(1)
Delete row button :
var curr_row = poRow.index
poRow.instanceManager.removeInstance(curr_row)
With the above structure and script, the issue is resolved.
Hope this helps .
Thanks,
Saujanya
Edited by: Saujanya on Jun 29, 2010 9:36 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.