AllenFang / AllenFang/react-bootstrap-table

BootstrapTable is not reloading data when row checkbox checked or unchecked in ReactJS

オープン
#2,137 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
2.2k
フォーク
761
PR マージ指標
30日以内にマージされた PR はありません

説明

Using BootstrapTable in reactjs app that populates data from .net core api.
My question is How to re-render data when row checkbox checked or unchecked.
I am displaying checkbox for one of the boolean column and disable/enable based on the row checkbox selection. Following is the code from columns definition

formatter: (cellContent:boolean, row:IFacilityReportType) => (


selectPrmaryContact(event, row)}
disabled={row.isRowSelected?false:true}
checked={row.isPrimary?true:false}
/>

)

In the above code, the isRowSelected is one of the data column that has false initially and all the checkboxes are disabled. When row checkbox checked/unchecked this column will get switch to true/false and column checkbox should be enable or disable. This is not happening. Its look like data is not rendering/reloading when column data changed in row selection.

Following is the row selection event code.

const selectRowFacilities:any = {
mode: 'checkbox',
selected:refeshFacilityTable==='yes'? []:null,
onSelect: (row:IFacilityReportType, isSelect:any, rowIndex:any, e:any) => {

if(isSelect){
row.isRowSelected=true;
}
else{
row.isRowSelected=false;
}

},
onSelectAll: (isSelect:any, rows:IFacilityReportType[], e:any) => {
if(isSelect){
rows.forEach(row=>{
row.isRowSelected=true;
});
}
else{
rows.forEach(row=>{
row.isRowSelected=false;
});
}
}
};

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。