Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Complex-databinding/ClientApp/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DataManager, Query, UrlAdaptor } from '@syncfusion/ej2-data';
@Component({
selector: 'app-root',
template: `
<ejs-treegrid [dataSource]='data' [query]="query" [treeColumnIndex]='1' height='400' idMapping='TaskID' parentIdMapping='ParentValue' hasChildMapping='isParent' >
<ejs-treegrid [dataSource]='data' [query]="query" [treeColumnIndex]='1' height='400' idMapping='TaskID' parentIdMapping='ParentValue' hasChildMapping='isParent' [allowPaging]="true" [pageSettings]="pagesettings" >
<e-columns>
<e-column field='TaskID' headerText='Task ID' width='90' textAlign='Right'></e-column>
<e-column field='TaskName' headerText='Task Name' width='180'></e-column>
Expand All @@ -21,5 +21,5 @@ export class AppComponent {
url: "Home/Datasource",
});
public query?: Query = new Query().expand('Tasks');

public pagesettings = { pageSize: 12, pageSizeMode: 'Root' };
}
4 changes: 2 additions & 2 deletions Complex-databinding/ClientApp/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BrowserModule } from '@angular/platform-browser';

import { AppComponent } from './app.component';
import { GridModule } from '@syncfusion/ej2-angular-grids';
import { TreeGridModule } from '@syncfusion/ej2-angular-treegrid';
import { TreeGridModule, PageService } from '@syncfusion/ej2-angular-treegrid';

@NgModule({
declarations: [
Expand All @@ -13,7 +13,7 @@ import { TreeGridModule } from '@syncfusion/ej2-angular-treegrid';
BrowserModule,
GridModule, TreeGridModule
],
providers: [],
providers: [PageService],
bootstrap: [AppComponent]
})
export class AppModule { }
8 changes: 4 additions & 4 deletions Complex-databinding/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,20 @@ public static List<TreeData> GetTree()
if (tree.Count == 0)
{
int root = 0;
for (var t = 1; t <= 5; t++)
for (var t = 1; t <= 25; t++)
{
Random ran = new Random();
root++;
int rootItem = root;

tree.Add(new TreeData() { TaskID = rootItem, TaskName = "Parent task " + rootItem.ToString(), isParent = true, IsExpanded = true, ParentValue = null, Duration = ran.Next(1, 50), Tasks = new TaskDetails { Name = "Parent" } });
tree.Add(new TreeData() { TaskID = rootItem, TaskName = "Parent task " + rootItem.ToString(), isParent = true, IsExpanded = true, ParentValue = null, Duration = ran.Next(1, 50), Tasks = new TaskDetails { Name = "Parent"+ rootItem.ToString() } });
int parent = root;
int subparent = root;
for (var c = 0; c < 3; c++)
{
root++;
int childID = root;
tree.Add(new TreeData() { TaskID = childID, TaskName = "sub Child task " + childID.ToString(), ParentValue = subparent, Duration = ran.Next(1, 50), Tasks = new TaskDetails { Name = "Sub child" } });
tree.Add(new TreeData() { TaskID = childID, TaskName = "sub Child task " + childID.ToString(), ParentValue = subparent, Duration = ran.Next(1, 50), Tasks = new TaskDetails { Name = "Sub child" + childID.ToString()} });
}
}

Expand All @@ -104,4 +104,4 @@ public static List<TreeData> GetTree()
}
}

}
}
5 changes: 2 additions & 3 deletions Complex-databinding/SyncfusionAngularASPNETMVC.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Startup.cs" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<Content Include="Content\bootstrap-grid.css" />
<Content Include="Content\bootstrap-grid.min.css" />
Expand Down Expand Up @@ -325,4 +324,4 @@
</Target>
<Target Name="AfterBuild">
</Target> -->
</Project>
</Project>