I am new to ng2-smart-tables. I am trying to modify the example below on a GitHub page so that the checkboxes do not disappear when going from page to page.
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: 'Sincere@april.biz', }, { id: 2, name: 'Ervin Howell', username: 'Antonette', email: 'Shanna@melissa.tv', }, { id: 3, name: 'Clementine Bauch', username: 'Samantha', email: 'Nathan@yesenia.net', }, { id: 4, name: 'Patricia Lebsack', username: 'Karianne', email: 'Julianne.OConner@kory.org', }, { id: 5, name: 'Chelsey Dietrich', username: 'Kamren', email: 'Lucio_Hettinger@annie.ca', }, { id: 6, name: 'Mrs. Dennis Schulist', username: 'Leopoldo_Corkery', email: 'Karley_Dach@jasper.info', }, { id: 7, name: 'Kurtis Weissnat', username: 'Elwyn.Skiles', email: 'Telly.Hoeger@billy.biz', }, { id: 8, name: 'Nicholas Runolfsdottir V', username: 'Maxime_Nienow', email: 'Sherwood@rosamond.me', }, { id: 9, name: 'Glenna Reichert', username: 'Delphine', email: 'Chaim_McDermott@dana.io', }, { id: 10, name: 'Clementina DuBuque', username: 'Moriah.Stanton', email: 'Rey.Padberg@karina.biz', }, { id: 11, name: 'Nicholas DuBuque', username: 'Nicholas.Stanton', email: 'Rey.Padberg@rosamond.biz', }, ]; }
This uses selectMode: 'multi'option to display the checkbox column. These checkboxes show, but every time I use pagination links to go to another page, the selection is cleared. I am trying to solve this problem because I have a problem in my project that is similar to this.
I tried to find documentation on how to save the selection on different pages, but was not successful, since only a limited amount of documentation is available. It looks like a function that is common enough that there should be more information about it, but it doesn't seem to be that way. Any help on this would be greatly appreciated.