Skip to content
Merged
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
24 changes: 12 additions & 12 deletions examples/kendo-react-sales-dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
"dependencies": {
"@progress/kendo-data-query": "^1.7.0",
"@progress/kendo-drawing": "^1.21.1",
"@progress/kendo-react-buttons": "^10.0.0",
"@progress/kendo-react-charts": "^10.0.0",
"@progress/kendo-react-dateinputs": "^10.0.0",
"@progress/kendo-react-dialogs": "^10.0.0",
"@progress/kendo-react-dropdowns": "^10.0.0",
"@progress/kendo-react-grid": "^10.0.0",
"@progress/kendo-react-inputs": "^10.0.0",
"@progress/kendo-react-intl": "^10.0.0",
"@progress/kendo-react-layout": "^10.0.0",
"@progress/kendo-react-pdf": "^10.0.0",
"@progress/kendo-react-ripple": "^10.0.0",
"@progress/kendo-theme-material": "^10.0.1",
"@progress/kendo-react-buttons": "^11.0.0",
"@progress/kendo-react-charts": "^11.0.0",
"@progress/kendo-react-dateinputs": "^11.0.0",
"@progress/kendo-react-dialogs": "^11.0.0",
"@progress/kendo-react-dropdowns": "^11.0.0",
"@progress/kendo-react-grid": "^11.0.0",
"@progress/kendo-react-inputs": "^11.0.0",
"@progress/kendo-react-intl": "^11.0.0",
"@progress/kendo-react-layout": "^11.0.0",
"@progress/kendo-react-pdf": "^11.0.0",
"@progress/kendo-react-ripple": "^11.0.0",
"@progress/kendo-theme-material": "^11.0.2",
"hammerjs": "^2.0.8",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
10 changes: 5 additions & 5 deletions examples/kendo-react-sales-dashboard/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ class App extends Component {
let headerText = this.state.value.replace('Sales','');
return (
<Ripple>
<div className="buttons-right mt-1">
<Button themeColor={'primary'} onClick={this.handleShare} className='mr-2'>Share</Button>
<Button onClick={this.handlePDFExport}>Export to PDF</Button>
</div>
<div className="app-container" ref={(app) => this.app = app}>
<div className="row">
<div className="col-xs-9 col-sm-9 col-md-9 col-lg-9 col-xl-9">
<h1>Sales | {headerText}</h1>
</div>
</div>
<div className="buttons-right mt-1">
<Button themeColor={'primary'} onClick={this.handleShare} className='mr-2'>Share</Button>
<Button onClick={this.handlePDFExport}>Export to PDF</Button>
</div>
</div>
<div className="row">
<div className="col-xs-3 col-sm-3 col-md-3 col-lg-3 col-xl-3">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Grid, GridColumn as Column } from '@progress/kendo-react-grid';
import { Sparkline } from '@progress/kendo-react-charts';
import { process } from '@progress/kendo-data-query';
import { Checkbox } from '@progress/kendo-react-inputs';

class SparkLineChartCell extends React.Component {
render (){
Expand All @@ -11,52 +11,44 @@ class SparkLineChartCell extends React.Component {
}
}

class ActiveCell extends React.Component {
render() {
console.log(this.props.dataItem);
return (
<td><Checkbox disabled defaultChecked={this.props.dataItem[this.props.field]} /></td>
)
}
}

export default class GridContainer extends React.Component {

state = {
dataState:{
sort:[{
field: "UnitPrice",
dir:"asc"
}]
}
}
processData = (data) => {
data.forEach(item => {
item.PriceHistory = Array.from({length: 40}, () => Math.floor(Math.random() * 100));
return item
})
return process(data,this.state.dataState);
return data;
}

handleDataStateChange = (e) => {
this.setState({
dataState: e.dataState
})
}

render() {
return (
<div>
<Grid
style={{ height: '300px' }}
data={this.processData(this.props.data)}
{...this.state.dataState}
onDataStateChange={this.handleDataStateChange}
defaultSort={[{
field: "UnitPrice",
dir:"asc"
}]}
sortable
>
<Column field="ProductID" title="ID" sortable={false} width="40px"/>
<Column field="ProductName" title="Name" />
<Column field="ProductName" title="Name" />
<Column field="UnitPrice" title="Price" width="100px" />
<Column field="UnitsInStock" title="In stock" sortable={false} width="100px"/>
<Column field="PriceHistory" title="Price history" cell={SparkLineChartCell}sortable={false} width="200px"/>
<Column field="Discontinued" title="Active" sortable={false} width="100px"
cell={(props) => (
<td>
<input type="checkbox" disabled className="k-checkbox" defaultChecked={props.dataItem[props.field]} />
<label className="k-checkbox-label"></label>
</td>
)} />
<Column field="PriceHistory" title="Price history" cells={{ data: SparkLineChartCell }} sortable={false} width="200px"/>
<Column field="Discontinued" title="Active" sortable={false} width="70px" cells={{ data: ActiveCell }} />
</Grid>
</div>
);
Expand Down