Hi
my requirements is i have 2 grids one after the other when i add a row in the first grid i have to get one row automatically in the 2nd grid [second grid will be user input grid]
can anyone help me on this
Discussion posts and replies are publicly visible
I hope you are storing the data in local variable, in this case, set the refreshAfter attribute on a local variable which is used to populate the second grid.
This depends to a great extent on details you haven't provided here - your data structure, the nature of the relationship between corresponding rows on both grids, etc.
In general I can offer this: the "add row" link in an editable grid can do basically anything you want, as a DynamicLink. That includes the ability to add new/blank rows to two separate arrays at the same time, just as a more concrete hint. That's true regardless of whether the arrays are stored in local variables, or in Rule Inputs (or a mixture of both).
While adding the row in the first grid from the dynamic link. on click, append 1 row to the second grid variable as well.
can you please give snippet of it that would be helpful
Hi,
While using the editable grids we have a parameter as addRowLink there you can append new values to both the items which you are using for the grids.
Hi, please refer to the below link for your reference.docs.appian.com/.../recipe-add-edit-and-remove-data-in-an-inline-editable-grid.html
Hi Ujjwal,
can you help me with the sample code so that it will be helpful for me. i have tried but not getting
Try to ignore the grids and concentrate on manipulating the underlying data stored in rule inputs or locals.
Please try to explain what you tried and what failed. Do you have some code snippets you can share?
Check this out..
= a!localVariables( local!items: { { item: null, qty: null, unitPrice: null }, }, local!item2: { { item_grid: null, item_qty: null } }, { a!gridLayout( label: "Products1", instructions: "Update the item name, quantity, or unit price.", headerCells: { a!gridLayoutHeaderCell(label: "Item"), a!gridLayoutHeaderCell(label: "Qty"), a!gridLayoutHeaderCell(label: "Unit Price"), }, rows: a!forEach( items: local!items, expression: { a!gridRowLayout( contents: { a!textField( value: fv!item.item, saveInto: fv!item.item ), a!integerField(value: fv!item.qty, saveInto: fv!item.qty), a!floatingPointField( value: fv!item.unitPrice, saveInto: fv!item.unitPrice ), } ) } ), rowHeader: 1, addRowLink: a!dynamicLink( label: "Add new row", saveInto: { a!save( local!items, append( local!items, { item: null, qty: null, unitPrice: null } ) ), a!save( local!item2, append( local!item2, { item_grid: null, item_qty: null } ) ) } ) ), a!gridLayout( label: "Products2", instructions: "Update the item name, quantity, or unit price.", headerCells: { a!gridLayoutHeaderCell(label: "Item"), a!gridLayoutHeaderCell(label: "Qty"), }, rows: a!forEach( items: local!item2, expression: { a!gridRowLayout( contents: { a!textField( value: fv!item.item_grid, saveInto: fv!item.item_grid ), a!integerField( value: fv!item.item_qty, saveInto: fv!item.item_qty ), } ) } ), rowHeader: 1, addRowLink: a!dynamicLink( label: "Add new row", saveInto: { a!save( local!item2, append( local!item2, { item_grid: null, item_qty: null } ) ), a!save( local!items, append( local!items, { item: null, qty: null, unitPrice: null } ) ) } ) ) } )