Javascript/Sencha(164)
-
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 -
Sencha Uncaught TypeError: c is not a constructor
일반적으로 프레임워크가 지정된 클래스의 인스턴스를 확인하거나 생성할 수 없을 때 발생합니다The error "Uncaught TypeError: c is not a constructor" typically occurs when an attempt is made to instantiate a class or object that does not exist or is not correctly defined. In the context of ExtJS, this can happen for various reasons. Here's how to diagnose and resolve the issue:
2024.12.16 -
Sencha panel안의 items layout 정렬
panel의 중간에 보이도록 처리Ext.create('Ext.panel.Panel', { title: 'Vertical Alignment Example', width: 400, height: 300, layout: { type: 'vbox', // Vertical box layout align: 'center', // Center items horizontally pack: 'center' // Center items vertically }, items: [ { xtype: 'component', html: 'This is vertically centered!' } ..
2024.12.15