-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIO-4871 fixed calculated value issues
- Loading branch information
1 parent
c153d1b
commit 3a9d8f8
Showing
7 changed files
with
260 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
src/components/datagrid/fixtures/two-comp-with-allow-calculate-override.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
export default { | ||
type: 'form', | ||
display: 'form', | ||
components: [ | ||
{ | ||
label: 'Select', | ||
widget: 'choicesjs', | ||
tableView: true, | ||
data: { | ||
values: [ | ||
{ | ||
label: 'a', | ||
value: 'a' | ||
}, | ||
{ | ||
label: 'b', | ||
value: 'b' | ||
}, | ||
{ | ||
label: 'c', | ||
value: 'c' | ||
} | ||
] | ||
}, | ||
key: 'select', | ||
type: 'select', | ||
input: true | ||
}, | ||
{ | ||
label: 'Data Grid', | ||
reorder: false, | ||
addAnotherPosition: 'bottom', | ||
layoutFixed: false, | ||
enableRowGroups: false, | ||
initEmpty: false, | ||
tableView: false, | ||
defaultValue: [ | ||
{ | ||
firstName: '', | ||
lastName: '' | ||
} | ||
], | ||
calculateValue: "var temp = instance.defaultValue;\n if(data.select === 'a')\n {\n temp = [{'firstName': 'A f 1','lastName': 'A l 1'}];\n } else if(data.select === 'b') { \n temp = [{'firstName': 'B f 1','lastName': 'B l 1'} \n ,{'firstName': 'B f 2','lastName': 'B l 2'}];\n } else if(data.select === 'c') { \n temp = [{'firstName': 'C f 1','lastName': 'C l 1'}];\n }\n value = temp;", | ||
allowCalculateOverride: true, | ||
key: 'dataGrid', | ||
type: 'datagrid', | ||
input: true, | ||
components: [ | ||
{ | ||
label: 'First Name', | ||
tableView: true, | ||
key: 'firstName', | ||
type: 'textfield', | ||
input: true | ||
}, | ||
{ | ||
label: 'Last Name', | ||
tableView: true, | ||
key: 'lastName', | ||
type: 'textfield', | ||
input: true | ||
} | ||
] | ||
}, | ||
{ | ||
label: 'Data Grid 2', | ||
reorder: false, | ||
addAnotherPosition: 'bottom', | ||
layoutFixed: false, | ||
enableRowGroups: false, | ||
initEmpty: false, | ||
tableView: false, | ||
defaultValue: [ | ||
{ | ||
firstName: '', | ||
lastName: '' | ||
} | ||
], | ||
calculateValue: "var temp = instance.defaultValue;\n if(data.select === 'a')\n {\n temp = [{'firstName': 'A f 1','lastName': 'A l 1'}];\n } else if(data.select === 'b') { \n temp = [{'firstName': 'B f 1','lastName': 'B l 1'} \n ,{'firstName': 'B f 2','lastName': 'B l 2'}];\n } else if(data.select === 'c') { \n temp = [{'firstName': 'C f 1','lastName': 'C l 1'}];\n }\n value = temp;", | ||
allowCalculateOverride: true, | ||
key: 'dataGrid2', | ||
type: 'datagrid', | ||
input: true, | ||
components: [ | ||
{ | ||
label: 'First Name', | ||
tableView: true, | ||
key: 'firstName', | ||
type: 'textfield', | ||
input: true | ||
}, | ||
{ | ||
label: 'Last Name', | ||
tableView: true, | ||
key: 'lastName', | ||
type: 'textfield', | ||
input: true | ||
} | ||
] | ||
} | ||
] | ||
}; |