Skip to main content
added 704 characters in body
Source Link
Caspar Harmer
  • 20.6k
  • 4
  • 35
  • 69

I thinkIt looks like you just need to be referencing label rather than value ina separate component file that is referenced from your templates. I'm not 100% sure of this, but all the examples I have seen have a template file like this pickliststatic.html(in a child folder of the custom datatable):

<template>
  <c-custom-datatable-component value={value} custom-value={typeAttributes.value}>
  </c-custom-datatable-component>
</template>

Then in a separate component, the actual markup is defined:

<template>
  <span class="slds-truncate" title={labelvalue}>{labelvalue}</span>   
</template>

With Javascript:

import { LightningElement, api } from 'lwc';

export default class customDatatableComponent extends LightningElement {
  @api value;
  @api customValue; 
}

I'm not sure if your shortcut version is supported, but given what's happening ... I'd say perhaps not. All the rest of your code looks fine to me.

I think you just need to be referencing label rather than value in your pickliststatic.html:

<template>
  <span class="slds-truncate" title={label}>{label}</span>   
</template>

It looks like you need a separate component file that is referenced from your templates. I'm not 100% sure of this, but all the examples I have seen have a template file like this (in a child folder of the custom datatable):

<template>
  <c-custom-datatable-component value={value} custom-value={typeAttributes.value}>
  </c-custom-datatable-component>
</template>

Then in a separate component, the actual markup is defined:

<template>
  <span class="slds-truncate" title={value}>{value}</span>   
</template>

With Javascript:

import { LightningElement, api } from 'lwc';

export default class customDatatableComponent extends LightningElement {
  @api value;
  @api customValue; 
}

I'm not sure if your shortcut version is supported, but given what's happening ... I'd say perhaps not. All the rest of your code looks fine to me.

Source Link
Caspar Harmer
  • 20.6k
  • 4
  • 35
  • 69

I think you just need to be referencing label rather than value in your pickliststatic.html:

<template>
  <span class="slds-truncate" title={label}>{label}</span>   
</template>