Javascript(216)
-
Sencha Ajax 처리시 다른 것 클릭하지 못하도록 처리
Ext.getBody().mask(), Ext.getBody().unmask() 사용Ext.getBody().mask('Please wait...'); // Mask the entire application bodyExt.Ajax.request({ url: '/url', rawData: formData, headers: { 'Content-Type': null // Let the browser set the appropriate boundary }, success: function(response) { Ext.getBody().unmask(); // Remove the mask on success const result = Ext.decod..
2025.01.27 -
Sencha 첨부파일 input의 값이 'undefined'인 경우 처리
조치전: attach가 null인경우, 서버에서는 'undefined'로 출력됨const treeGrid = Ext.ComponentQuery.query('#tree')[0];const selection = treeGrid.getSelectionModel().getSelection()[0];if (!selection) { Ext.Msg.alert('Error', 'No location selected.'); return;}const id = selection.get('id');const attach = selection.get('attach');const formData = new FormData();formData.append('id', id);formData.append('attach', ..
2025.01.27 -
Sencha grid에서 추가된 row와 변경된 row 구분하기
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 { ..
2025.01.27 -
Sencha enctype="multipart/form-data"에서 파일 여러개 처리하기
'Content-Type': null 설정동일한 이름으로 파일 객체를 추가const formData = new FormData();formData.append('param1', 'abc');formData.append('param2', '111);formData.append('_csrf', document.getElementById('_csrf').innerText);// Add files to the form datanewRows.forEach(record => { formData.append('files', record.file); // Use 'files' as the key});Ext.Ajax.request({ url: '/url', rawData: formData, head..
2025.01.27 -
Javascript 문자열 연결하기
ASIS{ text: '이미지', dataIndex: 'image', align: 'center', width:100, renderer: function(value) { return ''; },},TOBE{ text: '이미지', dataIndex: 'image', align: 'center', width:100, renderer: function(value) { return ``; },},
2025.01.26 -
Sencha 서버 없이 local 디렉토리에서 CORS 에러 발생했을 때
index.htmlTest.jsExt.onReady(function () { // Create the grid var drawContainer = Ext.create('Home.view.file.DragDropGrid', { renderTo: Ext.getBody(), width: 500, height: 800, });DragDropGrid.js Ext.define('Home.view.file.DragDropGrid', { extend: 'Ext.panel.Panel', xtype: 'dragdropgrid', title: 'Drag and Drop File Upload', layout: 'fit', ..
2025.01.26