Editor select field table value issue

Editor select field table value issue

binexlinebinexline Posts: 27Questions: 10Answers: 0

Hello,

I have a datatable with inline editing with keytable enabled and one of the columns is select field.
Currently, when I select a value, the value of the select is being shown as the table value, but I want the label to be displayed.

Below is my select options

Array(42)
0: {label: "HST-CANADA: CANADA HST TAX", value: "HST-CANADA"}
1: {label: "OCREDIT: OT-ADMIN FEE (CC)", value: "OCREDIT"}
2: {label: "OE1O/F: OE-OCEAN FREIGHT CHARGE", value: "OE1O/F"}
3: {label: "OE2H/C: OE-HANDLING & EXPEDITING", value: "OE2H/C"}
4: {label: "OEBROKER: OE-FORWARDING COMPENSATION", value: "OEBROKER"}
5: {label: "OECFS: OE-RECEIVING, LOADING, BLOCKING", value: "OECFS"}
6: {label: "OE-CHRENT: OE-CHASSIS RENTAL FEE", value: "OE-CHRENT"}
7: {label: "OECUSTOM: OE-CUSTOMS CLEARANCE FEE", value: "OECUSTOM"}
8: {label: "OEDG: OE-DANGEROUS GOOD FEE", value: "OEDG"}
9: {label: "OEDHL: OE-DHL OR FEDEX EXPRESS FEE", value: "OEDHL"}
10: {label: "OEDRAYAG: OE-CONTAINER DRAYAGE FEE", value: "OEDRAYAG"}
11: {label: "OE-EMPTYCO: OE-EMPTY CONTRAINER RETURN", value: "OE-EMPTYCO"}
12: {label: "OEFORWRD: OE-FORWARDING FEES", value: "OEFORWRD"}
13: {label: "OEINS: OE-INSURANCE PREMIUM", value: "OEINS"}
and so on

Below is what is being displayed on the table

But I want below label to be shown on the table

Is there any way to display label, not the value?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,230Questions: 1Answers: 10,416 Site admin
    edited April 2021 Answer ✓

    This example does what you are looking for and might be of some help.

    What isn't clear from your post is if you are submitting the data to the server when the edit happens. If so, then you need to have the server return the data structure used for the row. The key really is that you need to have both the label and the value in the data structure - the label for the table, the value for Editor.

    Allan

  • binexlinebinexline Posts: 27Questions: 10Answers: 0

    @allan ,

    THANK YOU so much for your insight. Problem resolved! :D
    About how data are submitted, for now I'm only letting local table to be editted.
    Submitting data to the server will be considered in the future. Thank you for your advice!

    Best regards,
    Leanne

This discussion has been closed.