전체 글(809)
-
Javascript loop문에서 빠져나오기(중단하기)
Ext.Array.eachreturn은 작동하지 않음return false로 빠져나와야 함let hasChildNodes = false;Ext.Array.each(checkedRows, function (node) { if (node.hasChildNodes()) { Ext.Msg.alert('Warning', '하위 record가 있으면 삭제할 수 없습니다!'); hasChildNodes = true; // Mark that a child node was found return false; // Stop further iterations }});// Exit the function if child nodes were foundif (hasChildNode..
2024.12.22 -
PostgreSQL merge 구문
MERGE INTO target_table AS tUSING source_table AS sON t.id = s.idWHEN MATCHED THEN UPDATE SET column1 = s.column1WHEN NOT MATCHED THEN INSERT (column1, column2) VALUES (s.column1, s.column2);
2024.12.21 -
Javascript Object Literal 에러 방지 및 default값 설정
x, y, width, height가 없어도 에러 나지 않도록 함const data = { rectData: { x: 10, y: 20 }};// Using ?. to safely access propertiesconst x = data.rectData?.x; // 10const y = data.rectData?.y; // 20const width = data.rectData?.width; // undefinedconst height = data.rectData?.height; // undefinedconsole.log(x, y, width, height);x, y, width, hegith의 디폴트값 지정const data = { ..
2024.12.21 -
Sencha treepanel에서 체크된 row만 가져오기
test 컬럼이 체크된 row만 가져오기var treePanel = this.up('treepanel'); // Get the tree panelvar checkedRows = [];treePanel.getStore().each(function (record) { if (record.get('test')) { // Check if the 'test' column is checked checkedRows.push(record); // Add the record to the array }});// Now 'checkedRows' contains all the checked rows.console.log(checkedRows);
2024.12.21 -
Sencha treepanel view에서 모든 row 정보 가져오기
getNodes() 사용var tree = Ext.getCmp('treePanelId'); // Replace with your TreePanel IDvar view = tree.getView();var rows = view.getNodes(); // Get all rendered rows (DOM elements)console.log(rows);
2024.12.21 -
Sencha treepanel의 모든 row 가져오기
getRootNode() 사용var tree = Ext.getCmp('treePanelId'); // Replace with your TreePanel IDvar store = tree.getStore();var allNodes = [];store.getRootNode().cascadeBy(function(node) { allNodes.push(node);});// Output all nodesconsole.log(allNodes);
2024.12.21