tui.grid
tui.grid copied to clipboard
defaultValue setting error
Describe the bug grid columns ์ ๋ณด์ defaultValue ์ง์ ์ ํ๋ฉด์๋ ๊ฐ์ด ๋ณด์ด์ง๋ง getData์ ๊ฐ์ด ์์ต๋๋ค. (getData์ ๊ฐ์ด ๋ค์ด์์ด์ผ ํ์ง ์๋ ์ถ์ต๋๋ค.)
When defaultValue is specified for grid columns information, the value is visible on the screen, but there is no value in getData. (I think getData should contain a value.)
To Reproduce
- grid columns์ defaultValue ์ค์ . (artist, typeCode)
- row data 1๊ฑด ์ถ๊ฐ. (name์๋ง ๊ฐ์ ์ฃผ๊ณ ์ถ๊ฐ)
- ํ๋ฉด ํ์ธํ๋ฉด ํ 1๊ฐ ์ถ๊ฐ๋์ด์๊ณ name, artist, typeCode์ ๊ฐ์ด ๋ณด์.
- grid.getData() ๋ก ๊ฐ ํ์ธํ๋ ๊ฒฝ์ฐ name์๋ง ๊ฐ์ด ๋ค์ด์์.
- Set defaultValue in grid columns. (artist, typeCode)
- Add 1 row data. (Add a value to name only)
- If you check the screen, one row has been added. Values โโare shown in name, artist, and typeCode.
- When checking the value with grid.getData(), only name contains a value.
Expected behavior grid.getData() ๋ก ๊ฐ ํ์ธํ์ ๋ name, artist, typeCode์ ๊ฐ์ด ๋ค์ด์์ด์ผ ํจ.
When the value is checked with grid.getData(), values โโmust be included in name, artist, and typeCode.
Desktop (please complete the following information):
- OS : window 11
- Browser : chrome
- version : 105.0.5195.127
Additional Context screenshot and source

`
const grid = new tui.Grid({
el: document.getElementById('list'),
scrollX: false,
scrollY: false,
columns: [
{
header: 'Name',
name: 'name',
editor: 'text'
},
{
header: 'Artist',
name: 'artist',
editor: 'text',
defaultValue: 'defaultValue1'
},
{
header: 'Type',
name: 'typeCode',
formatter: 'listItemText',
defaultValue: '2',
editor: {
type: 'select',
options: {
listItems: [
{ text: 'Deluxe', value: '1' },
{ text: 'EP', value: '2' },
{ text: 'Single', value: '3' }
]
}
}
}
]
});
let gridData = [{name: 'name1'}];
grid.resetData(gridData);
var rowData = grid.getData(); // [{name: 'name1', artist: null, typeCode: null, ...}] -> Name, artist, and typeCode must have values.
`