Javascript(170)
-
Sencha grid 선택된 데이터 삭제 처리
const grid = btn.up('grid');const store = grid.getStore();const selection = grid.getSelectionModel().getSelection();if (selection.length > 0) {Ext.Array.each(selection, function (record) { if (record.phantom) { // Directly remove newly inserted rows store.remove(record); } else { // Flag existing rows as deleted record.set('flagDeleted', true); }});
2024.12.18 -
Sencha grid 데이터 합치
// Get new and updated recordsconst newRows = store.getNewRecords();const updatedRows = store.getUpdatedRecords();// Combine newRows and updatedRows into a single arrayconst combinedRows = Ext.Array.merge(newRows, updatedRows);
2024.12.18 -
Sencha grid 데이터 가져오기
신규 rowsconst grid = btn.up('grid');const = grid.getStore();const newRecords = store.getNewRecords();수정된 rowsconst grid = btn.up('grid');const store = grid.getStore();const updatedRecords = store.getUpdatedRecords(); 신규 + 수정 rowsconst grid = btn.up('grid');const store = grid.getStore();const modifiedRecords = store.getModifiedRecords();선택된 rowsconst grid = btn.up('grid');const store = grid.getSto..
2024.12.18 -
Sencha grid 신규 컬럼 여부 체크
신규 row는 record.phantom=true { text: 'Age', dataIndex: 'age', flex: 1, renderer: function (value, metaData, record) { if (!record.phantom) { metaData.tdCls = 'non-editable'; } return value; }, editor: { xtype: 'numberfield', allowBl..
2024.12.18 -
Sencha Grid cell 편집 동적 처리
Name 컬럼은 신규 Row인 경우만 편집이 가능함defaultEditor가 null이기 때문에 설정을 해줘야 함신규 Row는 record.phantom=truecolumns: [ { text: 'Name', dataIndex: 'name', flex: 1, getEditor: function (record, defaultEditor) { defaultEditor = { editor: { xtype: 'textfield', allowBlank: false }, }; // Allow editing only for new rows return record.phantom ? defaultEditor : null; } }, { text: 'Age', dataI..
2024.12.18 -
Javascript Uncaught TypeError: Assignment to constant variable.
원인const 변수의 값을 바꾸려고 할때 발생해결const를 let이나 var로 변경
2024.12.16