Javascript(216)
-
Sencha 이미지 원본 사이즈로 보여주기
load 이벤트에서는 layout이 처음에 refresh되지 않기 때문에 afterrender를 사용하여 onload()를 발생시킴{ xtype: 'image', //flex: 3, src: '/resources/image/floor_plan.png', alt: '도면', margin: '0 10 0 0', listeners: { afterrender: function(image) { const domImage = image.getEl().dom; domImage.onload = function() { const naturalWidth = domImage.naturalWidth; const naturalHeight = domImage.naturalHeight; image.s..
2024.12.08 -
Sencah treepanel에서 1 depth까지만 펼치기
getPath()를 통해서 원하는 depth를 설정하고, expand() 처리를 함success: function (response) { const data = Ext.decode(response.responseText); const treeData = buildTree(data); store.setRoot({ id: 0, expanded: true, children: treeData }); const rootNode = store.getRootNode(); const treeGrid = Ext.ComponentQuery.query('#location')[0]; treeGrid.getSelectionModel().select(rootNode); //treeGrid.expandAll(); rootNo..
2024.12.08 -
Sencha checkcolumn 체크 및 이벤트
text:''가 있어서 header의 라인이 2줄로 안보임Ext.application({ name: 'CheckboxHeaderGrid', launch: function () { Ext.create('Ext.grid.Panel', { renderTo: Ext.getBody(), width: 600, height: 400, title: 'Checkbox Header Grid Example', store: { fields: ['name', 'email', 'phone'], data: [ { name: ..
2024.12.08 -
Sencha treepanel drag&drop 적용
Ext.application({ name: 'TreeMultiplePluginsApp', launch: function () { Ext.create('Ext.container.Viewport', { layout: 'fit', items: [ { xtype: 'treepanel', title: 'TreePanel with Multiple Plugins', rootVisible: false, store: Ext.create('Ext.data.TreeStore', { ..
2024.12.05 -
Javascript array 및 map 처리
Ext.Array.each(selection, function (node) { if(node.getData().id.startsWith('extModel')) { node.remove(); } if(node.hasChildNodes()) { Ext.Msg.alert('Warning', '하위 record가 있으면 삭제할 수 없습니다!'); return; }});const selecteRecords = selection.map(record => record.getData());
2024.12.05 -
Sencha treepanel에서 값은 바뀌지 않고, depth에 따라 indent처리해서 보여주기
Ext.application({ name: 'ImageApp', launch: function () { Ext.create('Ext.container.Viewport', { layout: 'fit', items: [ { xtype: 'panel', title: 'Image Display', html: '' } ] }); }});{ text: '순서', dataIndex: 'index', flex: 1, editor: { xtyp..
2024.12.05