Results 1 to 4 of 4

Thread: testing grid summary feature

  1. #1
    Sencha Premium User
    Join Date
    Jan 2009
    Posts
    451
    Answers
    19

    Default Answered: testing grid summary feature

    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?

  2. 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');
        });
    });

  3. #2
    Sencha Premium User
    Join Date
    Jan 2009
    Posts
    451
    Answers
    19

    Default

    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.

  4. #3
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    London, England
    Posts
    361
    Answers
    62

    Default

    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
    Sales Engineer
    Sencha

  5. #4
    Sencha Premium User
    Join Date
    Jan 2009
    Posts
    451
    Answers
    19

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •