-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from dkamburov/master
Implement nested Column and Feature directives for IgGrid
- Loading branch information
Showing
6 changed files
with
319 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import {Component, Directive, Inject, ElementRef, EventEmitter, HostListener} from '@angular/core'; | ||
import {IgGridComponent, Column, Feature} from "../../src/igniteui.angular2.ts"; | ||
import {Northwind} from "./../data/northwind.ts"; | ||
import {bootstrap } from '@angular/platform-browser-dynamic'; | ||
import {FORM_DIRECTIVES} from '@angular/common'; | ||
|
||
declare var jQuery: any; | ||
|
||
@Component({ | ||
selector: 'my-app', | ||
templateUrl: "./igGrid-ComplexOptsTemplate.html", | ||
directives: [FORM_DIRECTIVES, IgGridComponent, Column, Feature ] | ||
}) | ||
export class AppComponent { | ||
private cols: Array<any>; | ||
private id: string; | ||
private data: any; | ||
private w: string; | ||
private h: string; | ||
private pKey: string; | ||
private isReadOnly: boolean = true; | ||
private cs: Array<any> = [{columnKey: "ProductID", readOnly: this.isReadOnly}]; | ||
private pi: number = 0; | ||
private idHeaderText: string = "Id"; | ||
private pages: Array<number> = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; | ||
|
||
constructor() { | ||
this.data = Northwind.getData(); | ||
|
||
this.id ='grid1'; | ||
this.w = '100%'; | ||
this.h = '400px'; | ||
this.pKey = 'ProductID'; | ||
|
||
this.cols = [ | ||
{ key: "ProductID", headerText: "Product ID", width:"50px", dataType:"number" }, | ||
{ key: "ProductName", headerText: "Name", width:"250px", dataType:"string" }, | ||
{ key: "QuantityPerUnit", headerText: "Quantity per unit", width:"250px", dataType:"string" }, | ||
{ key: "UnitPrice", headerText: "Unit Price", width:"100px", dataType:"number" } | ||
]; | ||
} | ||
} | ||
|
||
bootstrap(AppComponent); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Angular 2 IgniteUI custom component</title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" type="text/css" /> | ||
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" type="text/css" /> | ||
<link href="http://cdn-na.infragistics.com/igniteui/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" type="text/css" /> | ||
<link href="http://cdn-na.infragistics.com/igniteui/latest/css/structure/infragistics.css" rel="stylesheet" type="text/css" /> | ||
<link rel="stylesheet" href="../sample.css" /> | ||
|
||
</head> | ||
<body class="container"> | ||
|
||
<div class="navbar navbar-default navbar-fixed-top" role="navigation"> | ||
<div class="container"> | ||
<div class="navbar-header"> | ||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> | ||
<span class="sr-only">Toggle navigation</span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
</button> | ||
<a class="navbar-brand" href="/">Ignite UI Angular 2 components <span class="badge alert-info">Preview</span></a> | ||
</div> | ||
<div class="navbar-collapse collapse"> | ||
<ul class="nav navbar-nav"> | ||
<li><a href="/igniteui-angular2/index.html">Home</a></li> | ||
<li><a href="https://github.com/IgniteUI/igniteui-angular2">View on GitHub <i class="fa fa-github"></i></a></li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
<div> | ||
<h1 class="push-down-md"><a href="http://igniteui.com/grid/overview" target="_blank">igGrid</a></h1> | ||
|
||
<div class="row description"> | ||
<div class="col-md-12"> | ||
<p class="lead">This sample demonstrates how AngularJS components are used to initialize the igGrid complex options though the template.</p> | ||
<p><a href="https://github.com/IgniteUI/igniteui-angular2/blob/master/samples/igGrid/igGrid.html" class="btn btn-default btn-lg btn-primary" target="_blank"><i class="fa fa-code fa-lg"></i> Explore the Code</a></p> | ||
</div> | ||
</div> | ||
|
||
<my-app>Loading...</my-app> | ||
|
||
|
||
</div> | ||
<footer> | ||
<p> | ||
<a href="/igniteui-angular2/index.html">Home</a> | | ||
<a href="https://github.com/IgniteUI/igniteui-angular2/issues">Feedback & Questions</a> | | ||
<a href="https://github.com/IgniteUI/igniteui-angular2">Clone & Fork</a> | ||
</p> | ||
<p class="small">For more information or to download a trial of Ignite UI, please visit: <a href="http://www.igniteui.com">http://www.igniteui.com</a></p> | ||
</footer> | ||
|
||
<!-- 1. Load libraries --> | ||
<script src="http://code.jquery.com/jquery-1.12.3.js"></script> | ||
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script> | ||
<!-- IE required polyfills, in this exact order --> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.0/es6-shim.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.20/system-polyfills.js"></script> | ||
<script src="https://npmcdn.com/angular2/es6/dev/src/testing/shims_for_IE.js"></script> | ||
|
||
<script src="https://npmcdn.com/[email protected]?main=browser"></script> | ||
<script src="https://npmcdn.com/[email protected]/lib/typescript.js"></script> | ||
<script src="https://npmcdn.com/[email protected]"></script> | ||
<script src="https://npmcdn.com/[email protected]/dist/system.src.js"></script> | ||
<script src="./../../systemjs.config.js"></script> | ||
<!-- Ignite UI Required Combined JavaScript Files --> | ||
<script src="http://cdn-na.infragistics.com/igniteui/latest/js/infragistics.core.js"></script> | ||
<script src="http://cdn-na.infragistics.com/igniteui/latest/js/infragistics.lob.js"></script> | ||
|
||
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.js"></script> | ||
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script> | ||
<script> | ||
System.import('app.ts') | ||
.then(null, console.error.bind(console)); | ||
</script> | ||
</body> | ||
</html> |
20 changes: 20 additions & 0 deletions
20
samples/igGrid-ComplexOpts/igGrid-ComplexOptsTemplate.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<ig-grid [widgetId]='id' [width]='w' [autoCommit]='true' [dataSource]='data' [height]='h' [autoGenerateColumns]='false' [primaryKey]='"ProductID"'> | ||
<column [key]="'ProductID'" [(headerText)]="idHeaderText" [width]="'165px'" [dataType]="'number'"></column> | ||
<column [key]="'ProductName'" [headerText]="'Product Name'" [width]="'250px'" [dataType]="'string'"></column> | ||
<column [key]="'QuantityPerUnit'" [headerText]="'Quantity per unit'" [width]="'250px'" [dataType]="'string'"></column> | ||
<column [key]="'UnitPrice'" [headerText]="'Unit Price'" [width]="'100px'" [dataType]="'number'"></column> | ||
<feature [name]="'Paging'" [(currentPageIndex)]="pi" [pageSize]="'2'"></feature> | ||
</ig-grid> | ||
|
||
<br> | ||
<label for="pageIndex">Current Page Index:</label> | ||
<select [(ngModel)]="pi" name="pageIndex"> | ||
<option *ngFor="let i of pages">{{i}}</option> | ||
</select> | ||
<br> | ||
<label for="headerText">First column header text:</label><input name="headerText" [(ngModel)]="idHeaderText">{{idHeaderText}} | ||
</div> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.