Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
142576 | Apr 6,2018 07:26 AM UTC | Feb 12,2019 12:54 PM UTC | Angular - EJ 2 | 8 |
![]() |
Tags: TreeGrid |
$("#dataManager").click(function () {
dataManager = ej.DataManager({
url: window.baseurl + "Wcf/TreeGridGantt/TreeGantt.svc/SelfReferenceDatas",
crossDomain: true,
offline:true
});
var treegridObj = $("#TreeGridContainer").ejTreeGrid("instance");
var query = ej.Query().sortBy("TaskID", ej.sortOrder.Descending, false);
treegridObj.refresh(dataManager, query)
}) |
$("#updateRecord").click(function () {
var treegridObj = $("#TreeGridContainer").ejTreeGrid("instance");
treegridObj.refreshRow(3);//Passing the edited record index
}) |
click (event) {
var dataManager = new ej.DataManager(this.treeData),
treegridObj = $("#TreeGridControl").ejTreeGrid("instance"),
query = new ej.Query().sortBy("taskID", ej.SortOrder.Descending, false);
treegridObj.refresh(dataManager, query);
} |
clickRow (event) {
var treeObj = $("#TreeGridControl").ejTreeGrid("instance"),
item = treeObj.model.updatedRecords;
if(item.length > 0){
item[2].taskName = "NewName";
//To refresh the required record
treeObj.refreshRow(2);
}
} |
Hi Allyson,We have analyzed the reported error in our sample but unable to replicate it. Hence, we have prepared the sample and refreshed TreeGrid data source using “refresh” method.Please find the code example below:
click (event) {var dataManager = new ej.DataManager(this.treeData),treegridObj = $("#TreeGridControl").ejTreeGrid("instance"),query = new ej.Query().sortBy("taskID", ej.SortOrder.Descending, false);treegridObj.refresh(dataManager, query);}Please find the code example to refresh particular row using “refreshRow” method.
clickRow (event) {var treeObj = $("#TreeGridControl").ejTreeGrid("instance"),item = treeObj.model.updatedRecords;if(item.length > 0){item[2].taskName = "NewName";//To refresh the required recordtreeObj.refreshRow(2);}}Please find the sample from below locationPlease share your TreeGrid related code snippets or demo sample, if you are facing the same error again. We will help you to resolve this error.Regards,Jayakumar D
[default.html]
<button (click)='handleClick($event)' type='button'>Modify Record</button>
<div class="control-section">
<ejs-treegrid #treegrid [dataSource]='data' height='400' childMapping='subtasks' [treeColumnIndex]='1' [editSettings]='editSettings' [toolbar]='toolbar'>
-------
</ejs-treegrid>
</div>
……………………………………………………………………………………..
[default.component.ts]
import { Component, OnInit, ViewChild } from '@angular/core';
import { sampleData } from './jsontreegriddata';
import { ChangeEventArgs } from '@syncfusion/ej2-dropdowns';
import { TreeGridComponent , EditService , ToolbarService , PageService } from '@syncfusion/ej2-angular-treegrid';
import { DataManager, Query} from '@syncfusion/ej2-data';
@Component({
selector: 'control-content',
templateUrl: 'default.html',
providers: [EditService , ToolbarService , PageService]
})
export class DefaultComponent implements OnInit {
------
@ViewChild('treegrid')
public treegrid: TreeGridComponent;
ngOnInit(): void {
------
}
handleClick(event: Event) {
this.treegrid.grid.editModule.updateRow(0,{"taskID":1,"taskName": "Modifed","startDate": new Date(),"duration": 10})
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.