How to set grid row position in ej2?

What to do in order to add the inserted line to the end of the grid.

Essential JS 1 has a rowposition property. Setting rowposition="bottom" is enough. But Essential JS 2 doesnt have a rowposition property? What is the substitute of rowposition?






1 Reply

PS Pavithra Subramaniyam Syncfusion Team April 30, 2018 01:02 PM UTC

Hi Samet, 

We have checked your query and we have considered ‘Adding New row in bottom position of Grid’ as improvement feature. This feature will be available in any of our upcoming release. Until then you can use the following workaround to achieve your requirement. 

[app.component.ts] 
@Component({ 
  selector: 'app-root', 
  template:` <ejs-grid #grid [dataSource]='data|slice:0:9' [editSettings]='editSettings' [toolbar]='toolbar'  (actionComplete)='complete($event)'
    .    .    . 
    </ejs-grid>`, 
  styleUrls: ['./app.component.css'] 
}) 
export class AppComponent implements OnInit { 
  public data: Object[]; 
  public editSettings: Object; 
  public toolbar: string[]; 

  @ViewChild('grid') 
  public grid: GridComponent; 
  public ngOnInit(): void { 
    this.data = orderData; 
    this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true }; 
    this.toolbar = ['Add', 'Edit', 'Delete', 'Update', 'Cancel'] as any; 

  } 
  complete(e: any): void { 
    if (e.requestType === 'add') { 
      e.row.parentElement.appendChild(e.row); 
   } 
  } 


Regards, 
Pavithra S. 


Loader.
Up arrow icon