What would be the best way to test the contents of the summary row on a grid with a summary feature? Is there a way to do this using the ST futures API?
What would be the best way to test the contents of the summary row on a grid with a summary feature? Is there a way to do this using the ST futures API?
The Summary feature is its own component, and it renders a table that's docked to the bottom of the grid. So you can use the ST.table API to interact with it. Please try this example:
Code:// Scenario URL: https://examples.sencha.com/extjs/7.0.0/examples/kitchensink/frame-index.html#grid-exporter describe('Summary feature', function() { it('should check the values in the summary bar at bottom of grid', function() { ST.table('grid-exporter #summaryBar => table') .rowAt(0) .cellAt(1) .text('27'); }); });
For now I'm resorting to using Ext.query to look at the raw DOM.
Ext.query('tr.x-grid-row-summary > td')[0].innerHTML;
This works, but would still like something better, preferably built in to the ST API.
The Summary feature is its own component, and it renders a table that's docked to the bottom of the grid. So you can use the ST.table API to interact with it. Please try this example:
Code:// Scenario URL: https://examples.sencha.com/extjs/7.0.0/examples/kitchensink/frame-index.html#grid-exporter describe('Summary feature', function() { it('should check the values in the summary bar at bottom of grid', function() { ST.table('grid-exporter #summaryBar => table') .rowAt(0) .cellAt(1) .text('27'); }); });
Daniel Gallo
Thanks for the info on ST.table. That will work.
One point to note if others read this - the Summary feature doesn't have to be docked. If you don't specify a dock config option, the summary row renders within the existing grid view as the last row rather than another table and you have to modify things slightly.