ng2-smart-tablesを初めて使用しました。私はGitHubページから以下の例を変更して、ページ間を移動するときにチェックボックスが消えないようにしています。チェックボックスの列を表示するために「multi'option: 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: 'Karley_Da[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を使用しています。チェックボックスは表示されますが、ページ設定リンクを使用して別のページに移動するたびに選択がクリアされます。私は私のプロジェクトにこれに類似した問題があるので、この問題を解決しようとしています。選択肢をページ間で維持する方法についてのドキュメントを検索しようとしましたが、限られた量のドキュメントしか利用できないため、成功しませんでした。これは、そこにもっと多くの情報があるはずだが、そうではないような一般的な機能のようだ。この問題に関する助けをいただければ幸いです。