Skip to content

Drop down editor : Display label instead of Value  #934

@BharahthyKannan

Description

@BharahthyKannan

Hi ,
I am trying the drop down cell editor, giving different Label and Value. but I see the value is displayed on selection and not the Label.

How i can show selected Label rather than selected Value. Am i missing something here?

render(){

const stocks=[
    {id:1,name:'Books',owner:'Books',type:'E'},
    {id:2,name:'Books',owner:'Books',type:'E'},
    {id:3,name:'Books',owner:'Books',type:'E'},
    {id:4,name:'Books',owner:'Books',type:'E'},

        ]
    

const columns = [{
    dataField: 'id',
    text: 'Job ID'
  }, {
    dataField: 'name',
    text: 'Job Name'
  }, {
    dataField: 'owner',
    text: 'Job Owner'
  }, {
    dataField: 'type',
    text: 'Job Type',
    editor: {
      type: Type.SELECT,
      options: [{
        value: '1',
        label: 'A'
      }, {
        value: '2',
        label: 'B'
      }, {
        value: '3',
        label: 'C'
      }, {
        value: '4',
        label: 'D'
      }, {
        value: '5',
        label: 'E'
      }]
    }
  }];

return (

Value

<BootstrapTable
keyField="id"
data={ stocks }
columns={ columns }
cellEdit={ cellEditFactory({ mode: 'click', blurToSave: true }) }
/>

);

}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions