question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Select field (dropdown) in editble select mode

See original GitHub issue

Hi, I have to display Y or N options in dropdown in react bootstrap table cell. code:

const cellEdit={
	"mode":"click",
	blurToSave: true
}
function dropDownFormatter(cell,row){
	return(
	           <FormControl componentClass="select" defaultValue={cell}>
			<option value="Y">Y</option>
			<option value="N">N</option>
			</FormControl>
		)
}
<BootstrapTable data={this.state.serviceInfo.serviceConfigList} selectRow={selectRow}  cellEdit={cellEdit}>
    <TableHeaderColumn 
    dataField='archiveEnabled' 
   dataFormat={ dropDownFormatter}
    editable={{type:"select",options:{values:['y','N']}}} 
    width="120px">Archive Enable</TableHeaderColumn>
</BootstrapTable>

When Iam trying to edit my dropdown Iam getting following error.

TableBody.js:170 Uncaught TypeError: column.format(…).replace is not a function

Note: In tableBody.js we are getting this issue.

Thanks

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
supiash1commented, May 25, 2017

@AllenFang I had the similar problem , i used dropDownFormatter in dataFormat={ dropDownFormatter} the error i got is Uncaught TypeError: column.format(...).replace is not a function in var format = column.format ? function (value) { return column.format(value, data, column.formatExtraData, r).replace(/<.*?>/g, ''); } : false;

1reaction
Suman-Plivocommented, Aug 18, 2017

i would suggest to use plain HTML code instead of react-bootstrap tags (FormControl)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Editable 'Select' element - html - Stack Overflow
I would like to have a select element in the form but besides the options in the dropdown, it would be useful to...
Read more >
select list dropdown in edit mode - MSDN - Microsoft
User-305496339 posted. Just wondering how to show my edit view with a dropdownlistfor, with the appropriate value for the object selected.
Read more >
jQuery Editable Select - GitHub
jQuery Editable Select is a jQuery plugin that transforms a select into an input field where single elements are shown in real-time according...
Read more >
Example 11 - how to create editable select box in html
An editable dropdown is also called a " combobox "Here's a solution that simply sets the value of a text input whenever the...
Read more >
Editable select - CodePen
HTML ; 1. <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> ; 2. ​ ; 3. <div class="editable-select-container col-3"> ; 4. <!-- editable-select-id ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found