Javascript(216)
-
Sencha treepanel 체크박스 체크하면 css 적용하기
Ext.fly().toggle.Cls 사용{ xtype: 'checkcolumn', dataIndex: 'check', width: 50, listeners: { checkchange: function (column, rowIndex, checked, record) { record.commit(); // Commit changes to reflect visually // Apply a CSS class to visually indicate deletion const view = column.up('treepanel').getView(); const rowNode = view.ge..
2024.12.21 -
Sencha column의 값에 따라 삭제 표시 처리
flagDeleted로 값이 설정되면, 삭제표시 viewConfig: { getRowClass: function (record) { // Apply a CSS class to flagged rows return record.get('flagDeleted') ? 'deleted-row' : ''; } },
2024.12.21 -
Sencha button 이벤트 추가하기
{ xtype: 'button', text: 'Click Me', handler: function () { Ext.Msg.alert('Button Clicked', 'You clicked the button!'); }}
2024.12.19 -
Sencha container 오른쪽 정렬하기
{ xtype: 'container', layout: { type: 'hbox', // Horizontal layout pack: 'end', // Aligns child items to the right }, items: [ { xtype: 'button', text: 'Button 1' }, { xtype: 'button', text: 'Button 2' }, ],}
2024.12.19 -
Sencha grid 선택된 데이터 삭제 처리
const grid = btn.up('grid');const store = grid.getStore();const selection = grid.getSelectionModel().getSelection();if (selection.length > 0) {Ext.Array.each(selection, function (record) { if (record.phantom) { // Directly remove newly inserted rows store.remove(record); } else { // Flag existing rows as deleted record.set('flagDeleted', true); }});
2024.12.18 -
Sencha grid 데이터 합치
// Get new and updated recordsconst newRows = store.getNewRecords();const updatedRows = store.getUpdatedRecords();// Combine newRows and updatedRows into a single arrayconst combinedRows = Ext.Array.merge(newRows, updatedRows);
2024.12.18