当前位置:   article > 正文

JEECG表格选中状态怎么去掉

JEECG表格选中状态怎么去掉

官网代码(在取消选中状态的时候不生效)

  1. rowSelection() {
  2. return {
  3. onChange: (selectedRowKeys, selectedRows) => {
  4. console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
  5. },
  6. getCheckboxProps: record => ({
  7. props: {
  8. disabled: record.name === 'Disabled User', // Column configuration not to be checked
  9. name: record.name,
  10. },
  11. }),
  12. };
  13. },

修改后台的代码

  1. rowSelection() {
  2. const { selectedRowKeys } = this //必须加
  3. return {
  4. selectedRowKeys, //必须加
  5. onChange: (selectedRowKeys, selectedRows) => {
  6. this.selectedRowKeys = selectedRowKeys
  7. this.selectedRows = selectedRows
  8. },
  9. getCheckboxProps: (record) => ({
  10. props: {
  11. disabled: record.status !== 3, // Column configuration not to be checked
  12. status: record.status,
  13. },
  14. }),
  15. }
  16. },

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号