国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術文章
文章詳情頁

node.js - antdesign Table中的columns屬性怎么和組件關聯?

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

問題描述

const columns = [{ title: ’申報批次’, dataIndex: ’declareBatch’, sorter: true, /*render: name => `${name.first} ${name.last}`,*/ /*render:()=>count++,*/ width: ’18%’,}, { title: ’被考機構’, dataIndex: ’admittedOrganization’, width: ’19%’,}, { title: ’申報截止日期’, dataIndex: ’dueDate’, width: ’12%’,},{ title: ’考核時間’, dataIndex: ’examinationDate’, render: (msg => ( <span>{msg[0]+’~’+msg[1]}</span> )), width: ’20%’,},{ title: ’狀態’, dataIndex: ’type’, render: msg => msg === ’待確認’ ? <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={'確定要關閉該申報計劃嗎?'} onVisibleChange={this.onPopVisibleChange} onConfirm={this.onPopConfirm(record)} onCancel={this.onTableFootBatchAppointExpertClickCancel} visible={this.props.commonTableReduce.get(’popVisible’)}> 關閉</Popconfirm> </a> <span className='ant-pider'></span> <a><span id='check'>查看</span></a> </span>), width: ’12%’, } ];

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

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}//特別注意,需要設置表格主鍵唯一id的名稱,以優化react顯示 dataSource={commonTableReduce.get(’data’).toJSON()} pagination={false} loading={commonTableReduce.get(’loading’)} onChange={this.handleTableChangePrepare} onRowClick= {this.onRowClick} size='middle' ref='tableRef'

我網站打開發現clumn里的this是undefinednode.js - antdesign Table中的columns屬性怎么和組件關聯?

那我改怎么寫,或是哪里有問題?

問題解答

回答1:

把 columns 放到類里面去。

相關文章:
主站蜘蛛池模板: 灵宝市| 临清市| 斗六市| 白玉县| 台安县| 保定市| 克山县| 洱源县| 古交市| 伊金霍洛旗| 乌审旗| 封开县| 西林县| 磐安县| 铜山县| 馆陶县| 北票市| 上饶县| 睢宁县| 浪卡子县| 乌审旗| 称多县| 东乡县| 抚松县| 无为县| 黑水县| 上饶市| 武强县| 抚顺市| 贵德县| 慈溪市| 遂川县| 福泉市| 琼中| 和顺县| 沧州市| 华亭县| 安乡县| 顺平县| 大邑县| 禹城市|