ngx-datatable

How do you programmatically focus on a column/row in ngx-datatable?

十年热恋 提交于 2021-01-27 23:15:11
问题 Table version: 11.3.2 Angular version: 5.2.4 I am adding a new row to edit at the bottom of the table when a user clicks tab AND they are on the last column/row however I cannot get the focus to be set to the first column of the new row. Any advice on how I can focus programmatically on the first column of the new row? My HTML is : <div class="haulsScreen"> <h2 class="mat-h2">Hauls</h2> <ngx-datatable #mydatatable class="material" [headerHeight]="50" [limit]="20" [columnMode]="'force'"

Ngx-datatable set column width dynamically

做~自己de王妃 提交于 2020-07-18 11:29:26
问题 I'm storing the column widths of my ngx-datatable inside a database. I get these values using an AJAX call. How can I set these values for the datatable? What I've tried: setting the [width] property on the <ngx-datatable-column> element injecting the datatable as @ViewChild(DatatableComponent) table: DatatableComponent; and setting this.table.bodyComponent.columns[0].width = 500; I've tried these methods with and without this.table.recalculate(); , but nothing seems to work. EDIT I'm using

NGX-Datatables. How to get current table instance?

可紊 提交于 2020-06-29 04:06:10
问题 I have component with table, that receive RowData from another component by @Input. How can i get instance of current table. That's part of my html <ngx-datatable class="material" [rows]="inputData" [columns]="columns"> </ngx-datatable> And component ts export class GridComponent implements OnChanges { @Input() inputData: [object]; columns1 = [ { prop: 'name' }, { name: 'Gender' }, { name: 'Company' } ]; } 回答1: @Viewchild is the correct method, but you should be using it another way. Here is

Common 'wrapper' component for ngx-datatable

时光毁灭记忆、已成空白 提交于 2020-06-24 09:01:28
问题 Some introduction: We are currently developing an application based on Angular2 that is quite data-heavy. In order to show this data, we decided to give ngx-datatables a try. Plenty of components will be needed showing data in grids. We added a customized footer template as well as a kind of customized header showing a page size selector using a <select> element. The number of markup lines grew quite a lot, therefore we would like to move the definition <ngx-datatable> with header and footer

Common 'wrapper' component for ngx-datatable

孤人 提交于 2020-06-24 08:59:25
问题 Some introduction: We are currently developing an application based on Angular2 that is quite data-heavy. In order to show this data, we decided to give ngx-datatables a try. Plenty of components will be needed showing data in grids. We added a customized footer template as well as a kind of customized header showing a page size selector using a <select> element. The number of markup lines grew quite a lot, therefore we would like to move the definition <ngx-datatable> with header and footer

ngx-datatable footer customize

徘徊边缘 提交于 2020-01-22 18:00:07
问题 How to customize ngx datatable. I am not able to find, where I have to change the code to get rid of this total number of records and to replace it with a drop down to show items per page. My pagination are missing some icons too. 回答1: Use the custom footer template ( refer the link below ). so it overrides the default footer. https://github.com/swimlane/ngx-datatable/blob/master/demo/basic/footer.component.ts Examples If you want to just get rid of the footer, simply use: <ngx-datatable

ngx-datatable: How to display value of a property on a object in a row

和自甴很熟 提交于 2020-01-15 03:23:27
问题 I am struggling with something basic in ngx-datatable. In an angular-cli application I am binding an Array with 3 elements to the table and get displayed 3 (empty) rows. When I click a row I correctly get the object i have bound the row. I have used this http://swimlane.github.io/ngx-datatable/#single-selection as a starting point This is how it looks in the UI. The value of property StockName should be printed in each row. But it doesn't, but the value of a select row is correctly being