Javascript(216)
-
Sencha 이미지 사이즈 정보 가져오기
Case1Ext.application({ name: 'ImageSizeApp', launch: function () { Ext.create('Ext.container.Viewport', { layout: 'fit', items: [ { xtype: 'image', src: 'https://via.placeholder.com/150', // Replace with your image URL alt: 'Example Image', listeners: { ..
2024.12.05 -
Javascript 윈도우, 리눅스 상관없이 파일 경로 처리 하기
const filePath = "C:\\Users\\Public/Documents/file.txt";// Split the path into componentsconst components = filePath.split(/[\/\\]/);console.log(components);// Output: ['C:', 'Users', 'Public', 'Documents', 'file.txt']
2024.12.05 -
Javascript split 함수에 정규식 적용하기
'콤마, 세미콜론, 파이프'로 나누기const text = "apple,banana;cherry|date";const result = text.split(/[,;|]/); // Split on commas, semicolons, or pipesconsole.log(result);// Output: ['apple', 'banana', 'cherry', 'date']'스페이스바'로 나누기const text = "Hello World How Are You";const result = text.split(/\s+/); // Split on one or more spacesconsole.log(result);// Output: ['Hello', 'World', 'How', 'Are', 'You']2개만 ..
2024.12.05 -
Sencha panel에 html을 사용하여 이미지 나오게 하기
Ext.application({ name: 'ImageApp', launch: function () { Ext.create('Ext.container.Viewport', { layout: 'fit', items: [ { xtype: 'panel', title: 'Image Display', html: '' } ] }); }});
2024.12.05 -
Sencha treepanel row 선택하기
Row ID로 선택하기// Assuming your TreePanel is already created and has an id or referenceExt.onReady(function () { var treePanel = Ext.getCmp('myTreePanel'); // Replace 'myTreePanel' with your TreePanel's id // Get the selection model var selectionModel = treePanel.getSelectionModel(); // Find a node by id or some other identifier var node = treePanel.getStore().getNodeById('desiredNod..
2024.12.05 -
Javascript 시간 더하기
function addMinutesToCurrentTime(minutesToAdd) { const now = new Date(); // Get the current date and time now.setMinutes(now.getMinutes() + minutesToAdd); // Add 15 minutes return now;}// Example usageconst updatedTime = addMinutesToCurrentTime(15);console.log(updatedTime.toLocaleTimeString('en-US', { hour12: false })); // Example output: "15:30:00" (24-hour format)
2024.12.05