Solved
add grid automatically
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
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
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 }
)
)
}
)
)
}
)Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.