Sencha grid에서 추가된 row와 변경된 row 구분하기
2025. 1. 27. 22:18ㆍJavascript/Sencha
phantom을 통해서 구분함
const grid = this.up('grid');
const store = grid.getStore();
const modifiedRecords = store.getModifiedRecords();
if (modifiedRecords.length > 0) {
const newRows = [];
const changedRows = [];
// Separate new rows (phantoms) and changed rows
modifiedRecords.forEach(record => {
if (record.phantom) {
newRows.push(record.getData());
} else {
changedRows.push(record.getData());
}
});
}
'Javascript > Sencha' 카테고리의 다른 글
Sencha Ajax 처리시 다른 것 클릭하지 못하도록 처리 (0) | 2025.01.27 |
---|---|
Sencha 첨부파일 input의 값이 'undefined'인 경우 처리 (0) | 2025.01.27 |
Sencha enctype="multipart/form-data"에서 파일 여러개 처리하기 (0) | 2025.01.27 |
Sencha 서버 없이 local 디렉토리에서 CORS 에러 발생했을 때 (0) | 2025.01.26 |
Sencha grid에 record 추가 후에 변경상태로 설정하기 (0) | 2025.01.26 |