Javascript(170)
-
Sencha Custom js 파일 등록
app.json에 추가{ "name": "MyApp", "version": "1.0.0", "requires": [ "ext" ], "id": "MyApp", "js": [ { "path": "app.js", "bundle": true }, { "path": "resources/scripts/myCustomScript.js", "includeInBundle": false } ], "css": [ { "path": "resources/css/app.css", "bundle"..
2024.12.05 -
Javascript 날짜에 패턴 적용하기
function formatCustomDate(date, pattern) { // Replace year, month, day, hours, minutes, seconds dynamically const replacements = { 'YYYY': date.getFullYear().toString(), 'MM': (date.getMonth() + 1).toString().padStart(2, '0'), 'DD': date.getDate().toString().padStart(2, '0'), 'HH24': date.getHours().toString().padStart(2, '0'), // 24-hour format 'HH': (da..
2024.12.05 -
Sencha treepanel의 모든 node 펼치기
treepanel의 함수 사용var treePanel = Ext.ComponentQuery.query('treepanel')[0]; // Get your TreePanel instanceif (treePanel) { treePanel.expandAll(); // Expand all nodes console.log('All nodes have been expanded.');}store를 이용var treePanel = Ext.ComponentQuery.query('treepanel')[0]; // Get your TreePanel instancevar store = treePanel.getStore(); // Get the TreeStorestore.getRootNode().cascadeBy(f..
2024.12.05 -
Javascript 문자에서 접두사 검색
var str = "extTreePanel";if (str.startsWith('ext')) { console.log("The string starts with 'ext'.");} else { console.log("The string does not start with 'ext'.");}
2024.12.05 -
Sencha Object 접근하기
ComponentQuery 사용Ext.define('MyApp.controller.MainController', { extend: 'Ext.app.ViewController', alias: 'controller.main', getTreePanelInfo: function () { // Use ComponentQuery to find the TreePanel var treePanel = Ext.ComponentQuery.query('treepanel')[0]; // Adjust the selector if needed if (treePanel) { console.log('TreePanel Title:', treePanel.getTit..
2024.12.05 -
Sencha treepanel에서 선택된 row 정보 가져오기
treepanel에서 정보를 가져옴// Assuming 'treePanel' is the reference to your TreePanel instancevar selectedNodes = treePanel.getSelectionModel().getSelection();// Iterate through the selected nodesselectedNodes.forEach(function(node) { console.log('Selected Node:', node.get('text')); // Replace 'text' with the field name you want});Ext.create('Ext.tree.Panel', { title: 'Sample TreePanel', width:..
2024.12.05