{"action":"opened","issue":{"url":"https://api.github.com/repos/AllenFang/react-bootstrap-table/issues/795","repository_url":"https://api.github.com/repos/AllenFang/react-bootstrap-table","labels_url":"https://api.github.com/repos/AllenFang/react-bootstrap-table/issues/795/labels{/name}","comments_url":"https://api.github.com/repos/AllenFang/react-bootstrap-table/issues/795/comments","events_url":"https://api.github.com/repos/AllenFang/react-bootstrap-table/issues/795/events","html_url":"https://github.com/AllenFang/react-bootstrap-table/issues/795","id":185337692,"number":795,"title":"DataFormat not work","user":{"login":"ethorz","id":21173973,"avatar_url":"https://avatars.githubusercontent.com/u/21173973?v=3","gravatar_id":"","url":"https://api.github.com/users/ethorz","html_url":"https://github.com/ethorz","followers_url":"https://api.github.com/users/ethorz/followers","following_url":"https://api.github.com/users/ethorz/following{/other_user}","gists_url":"https://api.github.com/users/ethorz/gists{/gist_id}","starred_url":"https://api.github.com/users/ethorz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethorz/subscriptions","organizations_url":"https://api.github.com/users/ethorz/orgs","repos_url":"https://api.github.com/users/ethorz/repos","events_url":"https://api.github.com/users/ethorz/events{/privacy}","received_events_url":"https://api.github.com/users/ethorz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-26T09:14:12Z","updated_at":"2016-10-26T09:14:12Z","closed_at":null,"body":"Hi, data format not work, data gets by fetch.\r\nenumObject[cell] - undefined. In first init, this col is empty. Where the bug?\r\n\r\n`import React from 'react'\r\nimport ReactDOM from 'react-dom'\r\nimport { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table'\r\n\r\nfunction enumFormatter(cell, row, enumObject) {\r\n    return enumObject[cell];\r\n}\r\n\r\nvar block_section = {\r\n    0: \"Разблокировано\",\r\n    1: \"Заблокировано\"\r\n};\r\n\r\nclass Elements extends React.Component {\r\n\r\n    constructor(props) {\r\n        super(props);\r\n        this.state = {\r\n            data: [],\r\n            loading: true,\r\n        }\r\n    }\r\n\r\n    componentDidMount() {\r\n        fetch(\"../../Content/Themes/Home-v1/app/fakelist.json\")\r\n            .then((res) => res.json())\r\n            .then((data) => {\r\n                this.setState({ data, loading: false });\r\n            })\r\n            .catch((error) => console.log(error))\r\n    }\r\n\r\n    renderLoading() {\r\n        return <div>Загрузка...</div>;\r\n    }\r\n\r\n    renderTable() {\r\n        return (\r\n            <BootstrapTable data={this.state.data} striped={true} hover={true} pagination={true} options={{ hideSizePerPage: true, sizePerPage: 15 }}>\r\n                <TableHeaderColumn dataField=\"start_date\" headerAlign=\"center\">Начало публикации</TableHeaderColumn>\r\n                <TableHeaderColumn dataField=\"name\" headerAlign=\"center\" dataSort={true}>Название</TableHeaderColumn>\r\n                <TableHeaderColumn dataField=\"section\" headerAlign=\"center\">Раздел</TableHeaderColumn>\r\n                <TableHeaderColumn dataField=\"block_section\" filter={{ type: \"SelectFilter\", options: block_section, placeholder: \"Все\" }}\r\n                    dataFormat={ enumFormatter }\r\n                    formatExtraData={block_section}\r\n                    headerAlign=\"center\">Блокировка</TableHeaderColumn>\r\n                <TableHeaderColumn dataField=\"edit_date\" headerAlign=\"center\" width=\"125\">Дата изменения</TableHeaderColumn>\r\n                <TableHeaderColumn isKey={true} dataField=\"id\" width=\"55\" headerAlign=\"center\">ID</TableHeaderColumn>\r\n            </BootstrapTable>\r\n        )\r\n    }\r\n\r\n    render() {\r\n        return (\r\n            <div>\r\n                {this.state.loading ?\r\n                    this.renderLoading()\r\n                    : this.renderTable()}\r\n            </div>\r\n        )\r\n    }\r\n}\r\n\r\nexport default Elements;`"}}
{"actor":{"display_login":"ethorz"}}