akveo / akveo/ng2-smart-table

userRowSelect don't work on first click

Đang mở
#462 14 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
1.6k
Fork
867
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

It seems that in every first click in the grid, the `userRowSelect` event simply gets ignored. The next clicks (in any rows) work as expected.

No error is fired. This issue happens with any rows (first click in any row don't trigger, then next clicks in any rows start to work normally).

View code

```html

```

Controller code

```ts
export class NiveisListarComponent extends CRUD implements OnInit {
gridSelected;
gridSource: LocalDataSource;
gridData: object[];
settings = Grid.basicConfigWithName();

constructor(
router: Router
) {
super(router);
}

ngOnInit() {
this.getDataFromAPI();
}

handleGridSelected(event) {
this.gridSelected = event.selected[0];
console.log(this.gridSelected);
}

getDataFromAPI() {
this.Request.get(this.URL_CRUD_ENDPOINT)
.then((res) => {
this.gridData = res.data;
this.gridSource = new LocalDataSource(this.gridData);
this.gridSource.refresh();
});
}
}
```

Package.json dependencies (pkg versions)

```json
"dependencies": {
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"angular-2-dropdown-multiselect": "^1.4.2",
"animate.css": "^3.5.2",
"axios": "^0.16.2",
"core-js": "^2.4.1",
"diacritics": "^1.3.0",
"ng2-smart-table": "^1.2.1",
"tinymce": "^4.6.4"
},
"devDependencies": {
"@angular/cli": "^1.2.1",
"@angular/compiler-cli": "^4.0.0",
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"jeet": "^7.1.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"node-sass": "^4.5.3",
"protractor": "~5.1.0",
"sass-loader": "^6.0.5",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"
}
```

### Visual reproduction of the bug:
*(First click don't fire the event, then next clicks work normally)*
![grid-bug](https://user-images.githubusercontent.com/1953194/28795490-6e8eef94-7610-11e7-9d8f-cb9cbe6be1bc.gif)

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.