# Updating the elementSizer values

**URL:** https://discourse.nodered.org/t/updating-the-elementsizer-values/19089
**Category:** Developing Nodes
**Created:** [12 December 2019 21:59 UTC](https://discourse.nodered.org/t/updating-the-elementsizer-values/19089 "2019-12-12T21:59:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [12 December 2019 21:59 UTC](https://discourse.nodered.org/t/updating-the-elementsizer-values/19089/1 "2019-12-12T21:59:50Z")

</div>

Hi folks,

In my latest UI node I have (like in my other UI nodes) a normal **elementsizer** widget:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/9cd38426abf34599b7685292e28a3ffc3c167123.png)

Which is created like this:

```auto
oneditprepare: function() {
   $("#node-input-size").elementSizer({
      width: "#node-input-width",
      height: "#node-input-height",
      group: "#node-input-group"
   });
}

```

Works fine!  
However in this case I need to **dynamically change the width and height** , based on a checkbox in the config screen. But _the width and height in the element sizer box remain unchanged_ (i.e. "6x-1"). Even when I call the elementSize again (and I don't even know if this causes duplicates or other conflicts...):

```auto
oneditprepare: function() {
   $('#node-input-allowVideoDisplay').change(function () { 
      if (this.checked) {
         if ($('#node-input-height').val() == -1) { 
            // THESE NEW VALUES ARE NOT DISPLAYED IN THE ELEMENT SIZER ;-(
            $('#node-input-height').val(0);
            $('#node-input-width').val(0);
                        
            // CALLING THIS ONE AGAIN DOESN'T HELP EITHER ...
            $("#node-input-size").elementSizer({
               width: "#node-input-width",
               height: "#node-input-height",
               group: "#node-input-group"
            });
       }
  }
  ...        
}

```

Can I somehow refresh the element sizer, or should I removed some things from the DOM, or ...

Thanks !!!  
Bart
