• MarcelP
  • NEWBIE
  • 15 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Summer 18: I'm trying to display percentage values as this: 12.4% in lightning:datatable, but apparently type attributes minimumFractionDigits maximumFractionDigits do not work for columns with type percent, although the docs say that type percent can have the same attributes as type number, so my percentage always displays rounded (as 12%).
Any workaround for this (besides using aura:iteration for table creation instead of lightning:datatable and manually outputting percentage values with formattedNumber and % sign)?
I have the following component:
<aura:component >
	<aura:attribute name="options" type="List" default="[
        {label: 'Opt 1', value: 'opt1'},
        {label: 'Opt 2', value: 'opt2'},
        {label: 'Opt 3', value: 'opt3'}
    ]"/>
    <aura:attribute name="value" type="String[]"/>
    
    <lightning:checkboxGroup
        title="Group"
        aura:id="mygroup"
        name="checkboxGroup"
        label="Checkbox Group"
        options="{! v.options }"
        value="{! v.value }" />
    
    <lightning:formattedText value="{!'Checkbox group value: ' + v.value}"></lightning:formattedText>
    <br/>    
    <lightning:button label="Select Opt 1 and Opt 3" onclick="{!c.selectOpt1AndOpt3}"/>
</aura:component>

with the following controller:
({
    selectOpt1AndOpt3: function(component, event, helper) {
        component.set("v.value", ['opt1', 'opt3']);
    }
})

When the button is clicked, v.value is updated and the new value is reflected in lightning:formattedNumber, but lightning:checkboxGroup does not update with the new value or sometimes updates incorrectly (apparently random options are selected). This used to work in Spring 18, but since Summer 18 it doesn't work for me, so I assume this is a bug.
I have the following component:
<aura:component >
	<aura:attribute name="options" type="List" default="[
        {label: 'Opt 1', value: 'opt1'},
        {label: 'Opt 2', value: 'opt2'},
        {label: 'Opt 3', value: 'opt3'}
    ]"/>
    <aura:attribute name="value" type="String[]"/>
    
    <lightning:checkboxGroup
        title="Group"
        aura:id="mygroup"
        name="checkboxGroup"
        label="Checkbox Group"
        options="{! v.options }"
        value="{! v.value }" />
    
    <lightning:formattedText value="{!'Checkbox group value: ' + v.value}"></lightning:formattedText>
    <br/>    
    <lightning:button label="Select Opt 1 and Opt 3" onclick="{!c.selectOpt1AndOpt3}"/>
</aura:component>

with the following controller:
({
    selectOpt1AndOpt3: function(component, event, helper) {
        component.set("v.value", ['opt1', 'opt3']);
    }
})

When the button is clicked, v.value is updated and the new value is reflected in lightning:formattedNumber, but lightning:checkboxGroup does not update with the new value or sometimes updates incorrectly (apparently random options are selected). This used to work in Spring 18, but since Summer 18 it doesn't work for me, so I assume this is a bug.