Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Verified Answer
+1
person also asked this
people also asked this
Replies
7 replies
Subscribers
7 subscribers
Views
8327 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
Editable Grid - Dynamic columns
saravanana
over 8 years ago
Have anyone implemented "dynamic columns in editable grid"? Say for example my matrix rows and column vary per product or category
1. Category - 10 * 11 columns
2. Category - 10 * 3 columns etc. Rather than creating multiple SAIL rules, planning to use one SAIL rule for interface and one SAIL for grid layout.
OriginalPostID-251485
Discussion posts and replies are publicly visible
0
marky
over 8 years ago
You can make the grid dynamic by using apply for both the headerCells and GridRowlayout, calling a generic rule to generate the headercells, and a generic rule to generate the grid rows. It's not that difficult if you can understand how the apply function works. One thing that should know is that you should apply on an enumeration of the indices of the rows/columns and pass the entire dataset into the generic rules.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
marky
over 8 years ago
Example:
a!gridLayout
(
headerCells:
fn!apply
(
rule!genericRuleGeneratesHeaderCell
(
ri!columns,
_
),
fn!enumerate(fn!count(ri!columns))
),
rows:
fn!apply
(
rule!genericRuleGeneratesGridRow
(
ri!data,
_
),
fn!enumerate(fn!count(ri!data))
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
saravanana
over 8 years ago
Marky, I've already used apply for header cells, rows and column configs, what you see is taken from my sample rule, but the real issue is saving values from dynamic drop down column control..
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
marky
over 8 years ago
rule: genericRuleGeneratesGridRow
inputs:
data | any type
index | number(integer)
definition:
a!gridRowLayout
(
contents:
{
a!dropdownField
(
label:"Sample Dropdown",
value:ri!data[ri!index].integerField,
saveInto: ri!data[ri!index].integerField,
placeholderLabel:"-- Select --",
choiceLabels:{1,2,3},
choiceValues:{1,2,3}
)
}
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
saravanana
over 8 years ago
This will work only if one drop down column and save values in gridRowLayout..
here is the sample which is not working.. changing one dropdown chaning all row dropdown.. Any suggestion..
a!applyComponents(
function: a!dropdownField(
label: _,
choiceLabels: {1,2,3},
placeholderLabel: "--Select-- ",
choiceValues: {1,2,3},
value: ri!items[ri!index].response,
saveInto: ri!items[ri!index].response,
disabled: false()
),
arrayVariable : local!columnIndex,
array: 1+enumerate(count(ri!inputColumns)))
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
+1
saravanana
over 8 years ago
Resolve issue by using creating sub rule for drop down control and passing input value for response as array rather single value.. Thanks for your response Marky
Cancel
Vote Up
0
Vote Down
Sign in to reply
Reject Answer
Cancel
0
Sudipta Biswas
over 6 years ago
in reply to
marky
Can you explain more about this rule? whats its function?
rule!genericRuleGeneratesHeaderCell
(
ri!columns,
_
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel