-
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.
fixed calculated value for data grid component (#5448)
- Loading branch information
1 parent
ade37ab
commit 6269e94
Showing
7 changed files
with
159 additions
and
6 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
66 changes: 66 additions & 0 deletions
66
src/components/datagrid/fixtures/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,66 @@ | ||
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 = [\n {'firstName': 'initial 1','lastName': 'initial 2'},\n {'firstName': 'initial 1b','lastName': 'initial 2b'},\n ];\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 | ||
} | ||
] | ||
} | ||
] | ||
}; |
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