我是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'選項來顯示帶有複選框的列。複選框會顯示,但每次我使用分頁鏈接轉到另一頁時,該選擇被清除。我試圖解決這個問題,因爲我的項目有類似這樣的問題。
我試圖找到有關如何在頁面間持續選擇的文檔,但由於只有有限的文檔可用,因此不成功。這似乎是一個常見的功能,應該有更多關於此的信息,但似乎並非如此。任何有關這個問題的幫助將不勝感激。