Skip to content

Commit e84520f

Browse files
committed
columns, rows example
1 parent 8fd1c40 commit e84520f

File tree

7 files changed

+122
-1
lines changed

7 files changed

+122
-1
lines changed

examples/columns/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
[Open fullscreen](https://angular.activewidgets.com/columns/) | [Source on github](https://github.com/activewidgets/angular/tree/master/examples/columns) | [Edit on Codesandbox](https://codesandbox.io/s/github/activewidgets/angular/tree/master/examples/columns)
3+
4+
Angular example

examples/columns/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>Columns - ActiveWidgets/Angular</title>
6+
</head>
7+
<body>
8+
<div id="app"></div>
9+
<script src="src/main.js"></script>
10+
</body>
11+
</html>

examples/columns/package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "angular-columns",
3+
"version": "1.0.0",
4+
"description": "Columns - ActiveWidgets/Angular",
5+
"keywords": [],
6+
"main": "src/main.js",
7+
"scripts": {
8+
"start": "parcel index.html --open",
9+
"build": "parcel build index.html"
10+
},
11+
"dependencies": {
12+
"@activewidgets/angular": "0.0.10",
13+
"@angular/core": "^8",
14+
"@angular/common": "^8",
15+
"@angular/compiler": "^8",
16+
"@angular/compiler-cli": "^8",
17+
"@angular/platform-browser": "^8",
18+
"@angular/platform-browser-dynamic": "^8",
19+
"rxjs": "^6",
20+
"typescript": ">=3.4 <3.6",
21+
"zone.js": "~0.9.1"
22+
},
23+
"devDependencies": {
24+
"parcel-bundler": "^1"
25+
},
26+
"private": true
27+
}

examples/columns/src/app.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
import { Component } from '@angular/core';
3+
import { northwind } from "@activewidgets/examples/data";
4+
import './styles.css';
5+
6+
7+
const template = `<ax-datagrid [columns]="columns" [rows]="rows"></ax-datagrid>`;
8+
9+
10+
export class App {
11+
12+
constructor(){
13+
14+
this.columns = [
15+
{header: 'Code', field: 'customerID', width: 80, style: 'background:#def', fixed: true},
16+
{header: 'Company Name', field: 'companyName', width: 160},
17+
{header: 'Contact', field: 'contactName', width: 120},
18+
{header: 'Title', field: 'contactTitle', width: 120},
19+
{header: 'Address', field: 'address', width: 120},
20+
{header: 'City', field: 'city'},
21+
{header: 'Zip', field: 'postalCode', align: 'right'},
22+
{header: 'Phone', field: 'phone'},
23+
{header: 'Fax', field: 'fax'},
24+
{header: 'Country', field: 'country'}
25+
];
26+
27+
this.rows = northwind.customers;
28+
}
29+
30+
31+
static get annotations() { return [new Component({
32+
selector: '#app',
33+
template
34+
})]}
35+
}

examples/columns/src/main.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
import 'core-js/es7/reflect';
3+
import 'zone.js/dist/zone';
4+
5+
import { NgModule, enableProdMode } from '@angular/core';
6+
import { BrowserModule } from '@angular/platform-browser';
7+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
8+
import { AxModule } from '@activewidgets/angular';
9+
10+
import '@activewidgets/angular/css';
11+
12+
import { App } from './app.js';
13+
14+
15+
enableProdMode();
16+
17+
18+
class Module {
19+
static get annotations() { return [new NgModule({
20+
imports: [BrowserModule, AxModule],
21+
declarations: [App],
22+
bootstrap: [App]
23+
})]}
24+
}
25+
26+
platformBrowserDynamic().bootstrapModule(Module);
27+

examples/columns/src/styles.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
body {
3+
margin: 60px;
4+
font: 14px/1.2143 'Segoe UI', 'Avenir', 'Helvetica Neue', 'Tahoma', sans-serif;
5+
}
6+
7+
.ax-headers-view {
8+
font-weight: bold;
9+
color: #666;
10+
border-bottom: 1px solid #aaa;
11+
}
12+
13+
.ax-gridlines {
14+
border-bottom: 1px solid #eee;
15+
}

examples/viewer/examples.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11

22
import hello_world from '../hello-world/README.md';
3+
import columns from '../columns/README.md';
34

45

56
export const Local = {
6-
'Hello, World!': {path: 'hello-world', readme: hello_world}
7+
'Hello, World!': {path: 'hello-world', readme: hello_world},
8+
'Columns, rows': {path: 'columns', readme: columns}
79
};
810

911

0 commit comments

Comments
 (0)