Selected on Init
See original GitHub issueI need to select on init some rows, so I set on init some rows to this.selected. All good, but when I click + shift I unselect rows, Event selected says that I select none;
<ngx-datatable
#table
class="material"
[rows]="rows"
[columns]="columns"
[selected]="selected"
[selectionType]="'multi'"
[columnMode]="'force'"
[headerHeight]="24"
[footerHeight]="0"
[rowHeight]="40"
[scrollbarV]="true"
[scrollbarH]="false"
[messages]="{emptyMessage: 'No items have been added to the collection'}"
(select)='onSelect($event)'
(page)='onPage($event)'
(recalculate)=recalculate($event) >
<ng-template #editTmpl let-value="value" let-row="row" let-i="index" >
<span
*ngIf="!editing[row.$$index + '-name']">
{{value}}
</span>
<input #input autofocus type="text"
(blur)="updateValue($event, 'name', value, row, input)"
(keyup.enter)="updateValue($event, 'name', value, row, input)"
[hidden]="!editing[row.$$index + '-name']"
[value]="value"
[class.error]="row.error"
/>
<img class="rename-icon" src="assets/images/rename.png"
(click)="onRename( input, row )"
[hidden]="!checkingPermission(row, 'Update')" />
<!-- editing[row.$$index + '-name'] = true-->
</ng-template>
<ng-template #dateTmpl let-value="value" let-row="row" let-i="index">
<time>{{value | dateFormat }}</time>
</ng-template>
<ng-template #boolTmpl let-value="value" let-row="row" let-column="column" let-i="index">
<img class="validStatus-img" src="./assets/images/{{value?column.trueImg:column.falseImg}}" />
<span>{{value ? "Ok" : "Invalid"}}</span>
</ng-template>
</ngx-datatable>
Datatable 8.0.0 Angular 4
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:17 (1 by maintainers)
Top Results From Across the Web
How initialize dropdown (<select/>) with preselected value ...
So I've got dropdowns defined like that with selected option specified for preselecting the value from DB. <select id='selectId'> <option value= ...
Read more >Wrong option selected on init (x-for usage in select) · Issue #495
There are some issues with which option is selected when select's options are generated with x-for. See pen for demo.
Read more >init(_:selection:content:) | Apple Developer Documentation
A string that describes the purpose of selecting an option. selection. A binding to a property that determines the currently-selected option. content. A ......
Read more >Initialize select option - Get Help - Vue Forum
I want to initialize my Game in my GameList of my select with an object “selectedGame” located in my store vuex but with...
Read more >Select - Materialize
Select allows user input through specified options. ... Remember that this is a jQuery plugin so make sure you initialize this in your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found a way to make it work for my scenario - the key is to specify
[rowIdentity]="rowIdentity"
at the datatable html object. That way the component can compare the row in [rows] and [selected] and REALLY mark the “pre-selected” rows. Works like a charm, but the documentation is quite shallow on this (https://swimlane.gitbook.io/ngx-datatable/api/table/inputs#rowidentity).I have solved it by searching the DOM for the checkbox and clicking on them. Is working
El mié., 7 nov. 2018 19:48, Tim Schmidt notifications@github.com escribió: