AllenFang / AllenFang/react-bootstrap-table

"TypeError: this.getColumnsDescription(...) is undefined" when attempting to functionally render TableHeaderColumn elements

Đang mở
#1,380 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
2.2k
Fork
761
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hi, sorry if this doesn't belong here but not sure if I'm doing something wrong or there is something internally preventing the functional rendering of TableHeaderColumn elements. Am currently evaluating React table libraries for work with your library as the front-runner - for some reason have not seen any table library implemented with functional rendering of the column elements. Is there a specific reason why - am I just doing something wrong? Any help or guidance appreciated please.

`TypeError: this.getColumnsDescription(...) is undefined`

The code:

```
render() {

// string constant names different from remote data keys
const shopperTableColumnNamesKeys = Object.getOwnPropertyNames(ShopperTableColumnNames);

// for...in does not preserve Object key order, create list instead
const shopperRemoteDataKeys = Object.getOwnPropertyNames(shoppers[0]);

const createInitialTableHeaderColumn = (key, index) => {
return (

{ShopperTableColumnNames[shopperTableColumnNamesKeys[index]]}

);
};

const createTableHeaderColumn = (key, index) => {
return (

{ShopperTableColumnNames[shopperTableColumnNamesKeys[index]]}

);
};

const populateTableHeaderColumns = () => {
const tableColumns = [];
shopperRemoteDataKeys.forEach( (key, index) => {
index === 0
? createInitialTableHeaderColumn(key, index)
: createTableHeaderColumn(key, index);
;
});
};

return (



{populateTableHeaderColumns()}


);
}
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.