Comments (1)
Here is a temporary solution:
import { ListLifeCycleTypes } from '@alist/antd';
export default ($, actions) => {
console.log($, actions);
let crossPaginationSelectedRecords = new Set();
$(ListLifeCycleTypes.ON_LIST_MOUNTED).subscribe((payload) => {
// enable selection feature
actions.setRowSelection({ ids: [2] });
});
$(ListLifeCycleTypes.ON_LIST_SELECT_CHANGE).subscribe((payload) => {
console.log("ON_LIST_SELECT_CHANGE", payload);
try {
// remove current page's record
actions.getDataSource().map(t => t.id).forEach(item => {
crossPaginationSelectedRecords.delete(item);
});
// add current page's payload
payload.ids.forEach(id => crossPaginationSelectedRecords.add(id));
console.log('crossPaginationSelectedRecords => ', crossPaginationSelectedRecords)
} catch(err) {
console.log(err);
}
});
// https://github.com/alibaba/alist/issues/44
$(ListLifeCycleTypes.WILL_LIST_UPDATE).subscribe(() => {
// manually set
actions.crossPaginationSelectedRecords = crossPaginationSelectedRecords;
actions.setRowSelection({ ids: Array.from(crossPaginationSelectedRecords) });
console.log('WILL_LIST_UPDATE', actions.getRowSelection().records.map(t => t.id), crossPaginationSelectedRecords);
});
};
from alist.
Related Issues (20)
- core/form scrollToError not work HOT 1
- Repeater组件的每一行能否增加自定义按钮功能?自定义按钮支持条件显示? HOT 1
- 子组件未渲染完成时,不能获取formItem的name值 HOT 2
- 可否添加错误信息? HOT 1
- repeater 可否支持排序操作 HOT 1
- please correct the url typo HOT 1
- Typescript定义能否完善一些呢noform 和 nowrapper HOT 1
- 嵌套Form验证问题 HOT 1
- Repeater 嵌套 Repeater 时,第二个 repeater 新增按钮,需要点击两次 HOT 2
- 在 FormItem 里使用 render 渲染组件,在组件上 onChange 事件里 set 两个表单值,导致validate失效 HOT 1
- 使用React Hooks的问题 HOT 1
- 手册经常打不开 HOT 1
- 列表第一次渲染时,设置selectedRowKeys无效 HOT 4
- How does NoForm implement additional form tips in ANTD, such as :Extra
- 项目文档编写中西文混排时,单词左右要么留一个空格, 要么不留空格,统一下
- formily2什么时候能支持? HOT 8
- The official website https certificate has expired
- 自定义布局
- @alist/antd @alist/antd-components 能否在package.json 中增加module字段
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alist.