cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
114
Views
1
Helpful
2
Replies

ModulePrefs in gadget.xml - height is ignored in 12.6.2?

Occipital
Level 1
Level 1

After an update to 12.6.2, I'm finding that nearly all my custom gadgets are given default heights no matter what the XML requests in the ModulePrefs. One solution is to move declarative config into the init method of the gadget and request the value in

gadgets.window.adjustHeight( <put XML height here> )

Is this the new standard and the XML file is becoming obsolete?

Thanks,
Chris

1 Accepted Solution

Accepted Solutions

Is it possible you're running into a scenario like what is mentioned in this defect, like in the ES mentioned impacting some gadgets?
https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwk70259 

View solution in original post

2 Replies 2

Is it possible you're running into a scenario like what is mentioned in this defect, like in the ES mentioned impacting some gadgets?
https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwk70259 

Occipital
Level 1
Level 1

Bill,

I think that's exactly the root cause.  My quick-n-dirty fix was to move the height tag value from ModulePrefs in gadget.xml into the gadget's actual code and then add it to the options in my framework that handles a lot of the boilerplate stuff.  In its startup code, I added these lines:

this.gadgetContainer = $(`#gadgets-gadget-content-${this.gadgetid}`).parents('.react-grid-item').eq(1);

if (opts.notitle && opts.notitle == true) {
  this.titlebar.remove();
  if( opts.height ) {
    opts.height -= 28;
  }
}

setTimeout( () => {
      gadgets.window.adjustHeight(opts.height);
      this.gadgetContainer.css('height', opts.height+'px');
}, 100);