nhn / tui.grid

🍞🔡 The Powerful Component to Display and Edit Data. Experience the Ultimate Data Transformer!
http://ui.toast.com/tui-grid/
MIT License
2.42k stars 394 forks source link

input 기본값 null 수정이 가능한가요? #1864

Open KwonTaeyong opened 1 year ago

KwonTaeyong commented 1 year ago

image

안녕하세요 여러번의 구글링 후 해결방안이 따로 찾아지지 않아 문의 드립니다. appendRow 사용하여 행 추가 후 edit 을 이용하여 새로운 값을 넣어줄 상황인데 기본 input 상태값이 null로 들어오는것을 확인하였습니다 null 이 예를들어 "" 빈값으로 설정이 따로 가능할까요???

destiny891116 commented 1 year ago

/**

}

저는 이런식으로 해결했습니다.

KwonTaeyong commented 1 year ago

class CustomTextEditor { constructor(props) { const el = document.createElement('input'); const {maxLength} = props.columnInfo.editor.options;

    el.type = 'text';
    el.maxLength = maxLength;
    el.value = String(props.value ? props.value: "");

    this.el = el;
}

getElement() {
    return this.el;
}

getValue() {
    return this.el.value;
}

mounted() {
    this.el.select();
}

}

답변주신거를 참고하여 해결하였습니다 감사합니다.