JavaScript
Run Code
Open in Fiddle
Ext.application({ name : 'Fiddle', launch : function() { Ext.create('Ext.window.Window', { title: 'Hello', height: 200, width: 400, layout: 'form', listeners: { render: function () { Ext.theme.Material.setColors({ 'darkMode': true, 'base': 'green', 'accent': 'green' }); } }, items: [{ xtype: 'displayfield', itemId: 'myDisplayField', fieldLabel: 'Selected Locations', value: '111' },{ xtype:'button', text:'change location', handler: function(){ this.up().down('#myDisplayField').setValue('777'); const root = document.documentElement; root.style.setProperty('--dark-mode', true); root.style.setProperty('--base-color', 'green'); root.style.setProperty('--accent-color', 'green'); } }] }).show(); } });