10

有人可以建议任何数据表组件来进行本机反应,它可以动态添加行并具有可编辑的单元格。我在谷歌搜索完毕。提前致谢。

4

2 回答 2

0

我为这些功能引入了我自己的库!


    import DataTable, {COL_TYPES} from 'react-native-datatable-component';
        
    const SomeCom = () => {
    
         //You can pass COL_TYPES.CHECK_BOX Column's value in true/false, by default it will be false means checkBox will be uncheck!
         
         const data = [
               { menu: 'Chicken Biryani', select: false }, //If user select this row then this whole object will return to you with select true in this case
               { menu: 'Chiken koofta', select: true },
               { menu: 'Chicken sharwma', select: false }
         ]
         
         const nameOfCols = ['menu', 'select'];
         
         return(
              <DataTable
                   onRowSelect={(row) => {console.log('ROW => ',row)}}
                   data={data}
                   colNames={nameOfCols}
                   colSettings={[{name: 'select', type: COL_TYPES.CHECK_BOX}]}
              />
         )
    }

在此处输入图像描述 在此处输入图像描述

https://github.com/MuhammadRafeh/react-native-datatable-component

于 2021-08-05T05:47:50.537 回答