{"componentChunkName":"component---src-templates-doc-page-jsx","path":"/react/expressions-and-context/","result":{"data":{"markdownRemark":{"htmlAst":{"type":"root","children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Below shows a complex example making use of value getters (using expressions) and class rules (again using expressions). The grid shows 'actual vs budget data and yearly total' for widget sales split by city and country."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Location"}]},{"type":"text","value":" column is showing the aggregation groups, grouping by city and country."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Months"}]},{"type":"text","value":" are affected by the context. The data displayed is either "},{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"x_act"}]},{"type":"text","value":" or "},{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"x_bud"}]},{"type":"text","value":" data for the month (eg. "},{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"jan_act"}]},{"type":"text","value":" when jan is green, or "},{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"jan_bud"}]},{"type":"text","value":" when jan is red). Likewise the background color is also changed using class rules dependent on the selected month."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Total"}]},{"type":"text","value":" is the total 'actual' figures display, ie adding up all the green. This also changes (which columns to include) as the month is changed."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Notice that the example (including calculating the expression on the fly, the grid only calculates what's needed to be displayed) runs very fast (once the data is loaded) despite over 6,000 rows."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"This example is best viewed by opening it in a new tab."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"grid-example","properties":{"title":"Monthly Sales","name":"monthly-sales","type":"vanilla","options":"{ \"enterprise\": true, \"extras\": [\"fontawesome\", \"bootstrap\"] }"},"children":[]}]}],"data":{"quirksMode":false}},"frontmatter":{"title":"Expressions and Context","enterprise":null},"headings":[]}},"pageContext":{"frameworks":["javascript","angular","react","vue"],"framework":"react","srcPath":"/expressions-and-context"}},"staticQueryHashes":["1669547773","2635156907","4171589011"]}