저는 ng2-smart-tables를 처음 사용합니다. GitHub 페이지에서 아래 예제를 수정하여 페이지간에 이동할 때 확인란이 사라지지 않도록하십시오.ng2 스마트 테이블 확인란이 모든 페이지에서 영구적이지 않습니다.
import { Component } from '@angular/core';
@Component({
selector: 'basic-example-multi-select',
template: `
<ng2-smart-table [settings]="settings" [source]="data"></ng2-smart-table>
`,
})
export class BasicExampleMultiSelectComponent {
settings = {
selectMode: 'multi',
columns: {
id: {
title: 'ID',
},
name: {
title: 'Full Name',
},
username: {
title: 'User Name',
},
email: {
title: 'Email',
},
},
};
data = [
{
id: 1,
name: 'Leanne Graham',
username: 'Bret',
email: '[email protected]',
},
{
id: 2,
name: 'Ervin Howell',
username: 'Antonette',
email: '[email protected]',
},
{
id: 3,
name: 'Clementine Bauch',
username: 'Samantha',
email: '[email protected]',
},
{
id: 4,
name: 'Patricia Lebsack',
username: 'Karianne',
email: '[email protected]',
},
{
id: 5,
name: 'Chelsey Dietrich',
username: 'Kamren',
email: '[email protected]',
},
{
id: 6,
name: 'Mrs. Dennis Schulist',
username: 'Leopoldo_Corkery',
email: '[email protected]',
},
{
id: 7,
name: 'Kurtis Weissnat',
username: 'Elwyn.Skiles',
email: '[email protected]',
},
{
id: 8,
name: 'Nicholas Runolfsdottir V',
username: 'Maxime_Nienow',
email: '[email protected]',
},
{
id: 9,
name: 'Glenna Reichert',
username: 'Delphine',
email: '[email protected]',
},
{
id: 10,
name: 'Clementina DuBuque',
username: 'Moriah.Stanton',
email: '[email protected]',
},
{
id: 11,
name: 'Nicholas DuBuque',
username: 'Nicholas.Stanton',
email: '[email protected]',
},
];
}
이렇게하면 selectMode : 'multi'옵션을 사용하여 확인란이있는 열을 표시합니다. 확인란이 표시되지만 페이지 매김 링크를 사용하여 다른 페이지로 이동할 때마다 선택 항목이 지워집니다. 나는이 프로젝트와 비슷한 문제가 있기 때문에이 문제를 해결하려고 노력하고있다.
페이지 전체에서 선택 항목을 유지하는 방법에 대한 문서를 찾으려고했지만 한정된 양의 문서 만 사용할 수있어 성공하지 못했습니다. 이것은 거기에 더 많은 정보가 있어야만하는 공통적 인 기능인 것처럼 보이지만 그럴 것 같지 않습니다. 이 문제에 대한 도움을 주시면 감사하겠습니다.