How to add new row to ngx-datatable with input data from user?

Asked
Active3 hr before
Viewed126 times

5 Answers

inputdatatable
90%

When virtual scrolling is not in use, you can pass undefined for fluid heights,,If using virtual scrolling, you must pass a function or a number to calculate the heights

Example_snippet/controller/utility/_input.js/ sortAscending: 'datatable-icon. . .
sortAscending: 'datatable-icon-down', sortDescending: 'datatable-icon-up', pagerLeftArrow: 'datatable-icon-left', pagerRightArrow: 'datatable-icon-right', pagerPrevious: 'datatable-icon-prev', pagerNext: 'datatable-icon-skip'
load more v
88%

Inside this tutorial we will use the ngx-datatable package which was made for Angular apps, so we can perfectly use this inside our Ionic app as well!,Kinda nice for just a few lines of HTML that create everything from a given datasource, right?,To use this package inside your pages you first need to add it to the imports of the module, in our case we need to change the pages/table/table,module

Example_snippet/controller/utility/_input.js/ HomePage. . .
HomePage
load more v
72%

I have a use case where many different tables come from server (as JSON) and some data could be editable while user can add more data to the existing table without removing / overriding previous one, So the requirement is to have a 'Add New Row' functionality Didn't find anyway to perform this functionality,There should be some implementation for adding a new row,What would be the problem with the image? I see a normal list with the option of removing each line and the entered normal data!,But, I found another issue

Example_snippet/controller/utility/_input.js/ [ ] bug report => search githu. . .
[] bug report => search github
for a similar issue or PR before submitting
   [x] feature request[] support request => Please do not submit support request here, post on Stackoverflow or Gitter
load more v
65%

How can I add a new row to an ngx-datatable based on user input?,But how can I control the row so a user can add data to that row?, Outdated Answers: accepted answer is now unpinned on Stack Overflow , How is it possible that ket can rewrite in front of bra during matrix form?

Example_snippet/controller/utility/_input.js/ <ngx-datatable #mydatatable . . .
<ngx-datatable
  #mydatatable
  class="material"
  [headerHeight]="50"
  [limit]="5"
  [columnMode]="'force'"
  [footerHeight]="50"
  [rowHeight]="'auto'"
  [rows]="rows"
  [scrollbarH]="true">
  <ngx-datatable-column *ngFor="let label of labels" [name]="label.name" [prop]="label.prop">
    <ng-template ngx-datatable-cell-template let-rowIndex="rowIndex" let-value="value" let-row="row">
      <span
        title="double Click here "
        (dblclick)="editCell(label.prop, rowIndex)"
        *ngIf="!editing[rowIndex + '-' + label.prop]"
      >
        {{ value }}
      </span>
      <input
        autofocus
        (blur)="updateValue($event, label.prop, rowIndex)"
        (keyup.enter)="updateValue($event, label.prop, rowIndex)"
        *ngIf="editing[rowIndex+ '-' + label.prop]"
        [type]="label.inputType"
        class="form-control"
        [value]="value"
      />
    </ng-template>
  </ngx-datatable-column>
</ngx-datatable>
load more v
75%

,ngx-datatable

Example_snippet/controller/utility/_datatable.js/ npm. . .
npm