Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit of type "select" #289

Closed
dana2208 opened this issue Feb 21, 2016 · 2 comments
Closed

Edit of type "select" #289

dana2208 opened this issue Feb 21, 2016 · 2 comments
Labels

Comments

@dana2208
Copy link
Contributor

From the new version (1.5.2) there is a new issue.
When double-clicking on a cell of type "select" for editing it, then the cell displays a dropdown as it should.
Then when clicking the dropdown for selecting an option, the cell is not in edit mode anymore and the row is not selected anymore.
This makes it impossible to edit a cell of type select.

here is my code:
'use strict';
import React from 'react';
import {BootstrapTable, TableHeaderColumn} from 'react-bootstrap-table';
var products = [];
var qualityType = {
0: "good",
1: "bad",
2: "unknown"
};

function addProducts(quantity) {
var startId = products.length;
for (var i = 0; i < quantity; i++) {
var id = startId + i;
products.push({
id: id,
name: "Item name " + id,
quality: i%3
});
}
}

addProducts(5);

function enumFormatter(cell, row, enumObject){
return enumObject[cell];
}

export default class Example extends React.Component{

render(){
const selectRowProps = {clickToSelect: true, clickToSelectAndEditCell: true, mode: "radio"};
const cellEditProps = { mode: "dbclick"};
return (
<BootstrapTable data={products} cellEdit={cellEditProps} selectRow={selectRowProps}>
<TableHeaderColumn dataField="id" isKey={true}>Product ID</TableHeaderColumn>
<TableHeaderColumn dataField="name">Product Name</TableHeaderColumn>
<TableHeaderColumn dataField="quality" dataFormat={enumFormatter} formatExtraData={qualityType} editable={{type: "select", options: {values: [0,1,2]}}}>Product Quality</TableHeaderColumn>
</BootstrapTable>
);
}
};

Thank you

@AllenFang AllenFang added the bug label Feb 22, 2016
@AllenFang
Copy link
Owner

It will be fixed in next version

@AllenFang
Copy link
Owner

Released on v1.5.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants