动画

您是否注意到Excel如何使用动画移动选择框? 这种效果使眼睛更容易遵循选择。

您可以通过向选取框和单元格的样式添加过渡来向FlexGrid添加类似的效果。 通过使用鼠标或键盘选择单元格或范围来查看效果。

除了选框之外,您还可以为网格单元设置动画。 当您调整列的大小,拖动或排序时,会显示此效果。

import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; import './styles.css'; import * as wjGrid from '@grapecity/wijmo.grid'; // document.readyState === 'complete' ? init() : window.onload = init; // function init() { // // create some random data var countries = 'US,Germany,UK,Japan,Italy,Greece'.split(','), data = []; for (var i = 0; i < 200; i++) { data.push({ id: i, country: countries[i % countries.length], active: i % 5 != 0, downloads: Math.round(Math.random() * 200000), sales: Math.random() * 100000, expenses: Math.random() * 50000 }); } // // create the grid var theGrid = new wjGrid.FlexGrid('#theGrid', { itemsSource: data, showSelectedHeaders: 'All', showMarquee: true, deferResizing: true }); } <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>GrapeCity Wijmo FlexGrid and Excel-Style Animations</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script> System.import('./src/app'); </script> </head> <body> <div class="container-fluid"> <div id="theGrid"> </div> </div> </body> </html> .wj-flexgrid .wj-marquee, .wj-flexgrid .wj-header, .wj-flexgrid .wj-cell { transition: all .4s; /* want to play? -> http://cubic-bezier.com */ transition-timing-function: cubic-bezier(.5,0,.5,1) } .wj-flexgrid { max-height: 250px; margin-bottom: 24px; } import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; import './styles.css'; import { Component, enableProdMode, NgModule } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { BrowserModule } from '@angular/platform-browser'; import { WjGridModule } from '@grapecity/wijmo.angular2.grid'; @Component({ selector: 'app-component', templateUrl: 'src/app.component.html' }) export class AppComponent { data: any[]; constructor() { this.data = this._getData(); } private _getData() { // create some random data let countries = 'US,Germany,UK,Japan,Italy,Greece'.split(','), data = []; for (let i = 0; i < 200; i++) { data.push({ id: i, country: countries[i % countries.length], active: i % 5 != 0, downloads: Math.round(Math.random() * 200000), sales: Math.random() * 100000, expenses: Math.random() * 50000 }); } return data; } } @NgModule({ imports: [WjGridModule, BrowserModule], declarations: [AppComponent], bootstrap: [AppComponent] }) export class AppModule { } enableProdMode(); // Bootstrap application with hash style navigation and global services. platformBrowserDynamic().bootstrapModule(AppModule); <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>GrapeCity Wijmo FlexGrid and Excel-Style Animations</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Polyfills --> <script src="node_modules/core-js/client/shim.min.js"></script> <script src="node_modules/zone.js/dist/zone.min.js"></script> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.js"></script> <script src="systemjs.config.js"></script> <script> // workaround to load 'rxjs/operators' from the rxjs bundle System.import('rxjs').then(function (m) { System.set(SystemJS.resolveSync('rxjs/operators'), System.newModule(m.operators)); System.import('./src/app.component'); }); </script> </head> <body> <app-component></app-component> </body> </html> <div class="container-fluid"> <!-- the grid --> <wj-flex-grid #flex [showSelectedHeaders]="'All'" [showMarquee]="true" [deferResizing]="true" [(itemsSource)]="data"> </wj-flex-grid> </div> .wj-flexgrid .wj-marquee, .wj-flexgrid .wj-header, .wj-flexgrid .wj-cell { transition: all .4s; /* want to play? -> http://cubic-bezier.com */ transition-timing-function: cubic-bezier(.5,0,.5,1) } .wj-flexgrid { max-height: 250px; margin-bottom: 24px; } <template> <div class="container-fluid"> <!-- the grid --> <wj-flex-grid showSelectedHeaders="All" :showMarquee=true :deferResizing=true :initialized="initializeGrid" :itemsSource="data"> </wj-flex-grid> </div> </template> <script> import '@grapecity/wijmo.styles/wijmo.css'; import 'bootstrap.css'; import Vue from 'vue'; import * as wijmo from '@grapecity/wijmo'; import { WjGridModule } from '@grapecity/wijmo.vue2.grid'; new Vue({ el: '#app', data: { data: null }, methods: { initializeGrid(ctl) { this.data = this._getData() }, _getData() { // create some random data let countries = 'US,Germany,UK,Japan,Italy,Greece'.split(','), data = []; for (let i = 0; i < 200; i++) { data.push({ id: i, country: countries[i % countries.length], active: i % 5 != 0, downloads: Math.round(Math.random() * 200000), sales: Math.random() * 100000, expenses: Math.random() * 50000 }); } return data; } }, }); </script> <style> .wj-flexgrid .wj-marquee, .wj-flexgrid .wj-header, .wj-flexgrid .wj-cell { transition: all .4s; /* want to play? -> http://cubic-bezier.com */ transition-timing-function: cubic-bezier(.5,0,.5,1) } .wj-flexgrid { max-height: 250px; margin-bottom: 24px; } </style> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Highlight invalid cells</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script> System.import('./src/app.vue'); </script> </head> <body> <div id="app"> </div> </body> </html> import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; import './app.css'; // import * as React from 'react'; import * as ReactDOM from 'react-dom'; import * as wjGrid from '@grapecity/wijmo.react.grid'; class App extends React.Component { constructor(props) { super(props); this.state = { data: this.getData() }; } render() { return <div className="container-fluid"> <wjGrid.FlexGrid showSelectedHeaders="All" showMarquee={true} deferResizing={true} itemsSource={this.state.data}> </wjGrid.FlexGrid> </div>; } getData() { // create some random data let countries = 'US,Germany,UK,Japan,Italy,Greece'.split(','), data = []; for (let i = 0; i < 200; i++) { data.push({ id: i, country: countries[i % countries.length], active: i % 5 != 0, downloads: Math.round(Math.random() * 200000), sales: Math.random() * 100000, expenses: Math.random() * 50000 }); } return data; } } ReactDOM.render(<App />, document.getElementById('app')); <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>GrapeCity Wijmo FlexGrid and Excel-Style Animations</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script> System.import('./src/app'); </script> </head> <body> <div id="app"></div> </body> </html> .wj-flexgrid .wj-marquee, .wj-flexgrid .wj-header, .wj-flexgrid .wj-cell { transition: all .4s; /* want to play? -> http://cubic-bezier.com */ transition-timing-function: cubic-bezier(.5,0,.5,1) } .wj-flexgrid { max-height: 250px; margin-bottom: 24px; }