久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

node.js - antdesign Table中的columns屬性怎么和組件關(guān)聯(lián)?

瀏覽:119日期:2024-08-01 17:22:10

問(wèn)題描述

const columns = [{ title: ’申報(bào)批次’, dataIndex: ’declareBatch’, sorter: true, /*render: name => `${name.first} ${name.last}`,*/ /*render:()=>count++,*/ width: ’18%’,}, { title: ’被考機(jī)構(gòu)’, dataIndex: ’admittedOrganization’, width: ’19%’,}, { title: ’申報(bào)截止日期’, dataIndex: ’dueDate’, width: ’12%’,},{ title: ’考核時(shí)間’, dataIndex: ’examinationDate’, render: (msg => ( <span>{msg[0]+’~’+msg[1]}</span> )), width: ’20%’,},{ title: ’狀態(tài)’, dataIndex: ’type’, render: msg => msg === ’待確認(rèn)’ ? <span style={{color:'green'}}>{msg}</span> : (msg==='待提交'?<span style={{color:'orange'}}>{msg}</span>:(msg==='待審批'?<span style={{color:'red'}}>{msg}</span>:<span>{msg}</span>)), width: ’10%’,},{ title: ’備注’, dataIndex: ’note’, width: ’10%’,},{ title: ’操作’, key: ’operation’, render: (text, record) => ( <span> <a><Popconfirm placement='topLeft' title={'確定要關(guān)閉該申報(bào)計(jì)劃嗎?'} onVisibleChange={this.onPopVisibleChange} onConfirm={this.onPopConfirm(record)} onCancel={this.onTableFootBatchAppointExpertClickCancel} visible={this.props.commonTableReduce.get(’popVisible’)}> 關(guān)閉</Popconfirm> </a> <span className='ant-pider'></span> <a><span id='check'>查看</span></a> </span>), width: ’12%’, } ];

上面是Table中引用的clumn,最后一欄的操作里的Popconfirm的onVisibleChange等方法怎么調(diào)用下方的方法?

let AppTable = React.createClass({ onPopConfirm(record){ this.props.examineSubmittedTableAction.onPopConfirm(record,this.props.notificationAction,Notification) }, onPopCancel(){ this.props.examineSubmittedTableAction.onPopCancel() }, onPopVisibleChange(){ this.props.examineSubmittedTableAction.onPopVisibleChange() },

然后是Table的代碼

<Table //rowSelection={this.rowSelection} columns={columns} rowKey={record => record.id}//特別注意,需要設(shè)置表格主鍵唯一id的名稱,以優(yōu)化react顯示 dataSource={commonTableReduce.get(’data’).toJSON()} pagination={false} loading={commonTableReduce.get(’loading’)} onChange={this.handleTableChangePrepare} onRowClick= {this.onRowClick} size='middle' ref='tableRef'

我網(wǎng)站打開(kāi)發(fā)現(xiàn)clumn里的this是undefinednode.js - antdesign Table中的columns屬性怎么和組件關(guān)聯(lián)?

那我改怎么寫(xiě),或是哪里有問(wèn)題?

問(wèn)題解答

回答1:

把 columns 放到類里面去。

相關(guān)文章:
主站蜘蛛池模板: 龙口市| 临西县| 昌邑市| 靖宇县| 江阴市| 封开县| 织金县| 克拉玛依市| 冀州市| 本溪| 手机| 茶陵县| 全椒县| 三台县| 休宁县| 桂平市| 江陵县| 南皮县| 盐山县| 广安市| 洪洞县| 偃师市| 高碑店市| 光山县| 民勤县| 茶陵县| 德阳市| 彰化市| 曲阜市| 固安县| 仙居县| 博兴县| 绥宁县| 广昌县| 潜山县| 高密市| 托克逊县| 疏附县| 水城县| 慈利县| 巴马|