• Mike Wannamaker
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
I have a LWC datatable that when the window is resized larger sets the width of the table appropriately, but when I resize the window smaller, it doesn't recalculate and set the datatable size to be smaller.  Thus the datatable grows but never shrinks.

I would think the datatable should resize accordingly no matter what.

Interesting, if I put it into a lightning-layout, I need to have 2 layout items, the datatable will resize.  If i only have one layout item, the datatable does not resize properly.

Any help would be appreciated.
Thanks
onInit: function (component, event, helper) {
    // LWC Component in aura template like <c:coeGCWebUtil aura:id="coeWebUtility"/>
    const coeWebUtil = component.find("coeWebUtility");
    coeWebUtil.inMaintenanceMode($A.getCallback(function(mode) {
            console.log('inMaintenanceMode Returned: ' + mode + " : ", component.get("v.inMaintenanceMode"), " : ", component.get("v.renderMainContent"));
            component.set("v.inMaintenanceMode", mode);
            component.set("v.renderMainContent", !mode);
            console.log('inMaintenanceMode Returned: ' + mode + " : ", component.get("v.inMaintenanceMode"), " : ", component.get("v.renderMainContent"));
            // Tried below but still no worky.
            //$A.get('e.force:refreshView').fire();
        }));
}

I have the above code in an Aura component.  It finds the lwc component and calls the method. 
The LWC method makes a server side request, using promises and in .then() calls the given callback.
This all works.  The logs even indicate that the attributes are changing.  However the main aura template 
page does not get refreshed to render pieces that are wrapped with these attributes.
 
If I do this in a aura action call, it works fine.  But I have a couple aura components that are to call it so
I put it in my helper utility LWC component.  The LWC Component is just javascript with function exports
not extending lightning component.
 
Examples show that this is the way, so the question is why does it not work?  Is there something else I need to do?
 
Thanks
Mike
I have a LWC datatable that when the window is resized larger sets the width of the table appropriately, but when I resize the window smaller, it doesn't recalculate and set the datatable size to be smaller.  Thus the datatable grows but never shrinks.

I would think the datatable should resize accordingly no matter what.

Interesting, if I put it into a lightning-layout, I need to have 2 layout items, the datatable will resize.  If i only have one layout item, the datatable does not resize properly.

Any help would be appreciated.
Thanks