Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves willSelect bug on row selection (issue #502) #1045

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

NicolaLC
Copy link

According with the issue 502 this pull request resolves the first row selection bug with selectionMode != 'multi'.

This pull request also includes a new Output method for the ng2-smart-table component:

afterGridInit

Called after new Grid method completed, will pass the DataSet as param:

Example

  1. Set a callback for the Output:
<ng2-smart-table
        [...]
        (afterGridInit)="onGridInit($event)"
></ng2-smart-table>
  1. Do what you need after grid init, for example select a certain row:
  onGridInit(data: DataSet) {
    if ( !this.selectedData ) {
      return;
    }
    
    data.getRows().map(
      row => {
        if ( row.getData() === this.selectedData ) {
          data.selectRow(row);
        }
      }
    );
  }

Nicola added 5 commits July 22, 2019 12:17
**NEW** [afterGridInit] Output param - called when grid has been created and data is displayed - pass DataSet as Output param
Fixes test run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant