Results 1 to 7 of 7

Thread: Spreadsheet selection model getSelection doesn't return selected records

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-18860 in 6.0.2.437.
  1. #1
    Sencha Premium Member ragzovskii's Avatar
    Join Date
    Sep 2012
    Location
    Krasnoyarsk, Russia
    Posts
    242

    Default Spreadsheet selection model getSelection doesn't return selected records

    Hello.
    In this fiddle I log output of getSelection and getSelected method on spreadsheet model. Addocring to the getSelecton doc, I'd expect it to return records for selected cells, but result is empty list.

    steps to reproduce:
    1) select single cell, click on button -> selection is []
    2) select row by clicking on leftmost column -> selection is correct

  2. #2
    Sencha - Support Team bjdurham85's Avatar
    Join Date
    Mar 2014
    Posts
    962

    Default

    Thanks for the report, I've opened a ticket in our bug tracking system.


    Regards,
    Bryan

  3. #3
    Sencha User
    Join Date
    May 2016
    Posts
    10

    Default

    Why is this entry marked as fixed? I am having the same problem with version 6.0.2.437 and even with 6.2.0. If you start ragzovskii's fiddle and switch to 6.0.2.437, getSelection still returns an empty array for me. According to the API reference it should work...?

  4. #4
    Sencha Premium User
    Join Date
    Jan 2017
    Posts
    15

    Default

    I checked this in the latest version 6.2.1 and this is still broken. I keep encountering numerous posts Sencha marked as "Fixed" but when I check the "Fiddle" it is not working. I wonder if there is some other factor. I am running Chrome 54.0.2840.87 m (64-bit)

  5. #5
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108

    Default

    This issue is not a bug and not fixed by or related to EXTJS-18860.
    The getSelection method only returns selected rows.
    Code:
    getSelection: function() {
        // API docs are inherited.
        // Superclass returns array of selected records
        var selData = this.selected;
        if (selData && selData.isRows) {
            return selData.getRecords();
        }
        return [];
    }
    For selected cells use the spreadsheet selection model getSelected method.
    You can then use the grid selection eachCell method to iterate over the selected cells.
    The first parameter is the context object which contains the record (context.record).
    Code:
    handler: function() {
        var selected = panel.getSelectionModel().getSelected()
    
    
        selected.eachCell(function(context, column, row) {
            console.log(context.record)
        });
    }
    Fiddle example:
    https://fiddle.sencha.com/#fiddle/1s5t&view/editor
    Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services [email protected]

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  6. #6
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    2,425

    Default

    Quote Originally Posted by fmoseley View Post
    For selected cells sue the spreadsheet selection model getSelected method.
    I'm pretty sure the typo should be use instead.

  7. #7

    Default

    thank you I have the same problem in my work

Similar Threads

  1. Spreadsheet selection model and buffered store
    By LarssaAndin in forum Ext 5: Bugs
    Replies: 1
    Last Post: 14 Apr 2015, 8:59 AM
  2. Spreadsheet Selection Model in Architect
    By [email protected] in forum Sencha Architect 3.x: Q&A
    Replies: 1
    Last Post: 10 Mar 2015, 3:25 PM
  3. [FIXED] Spreadsheet selection model
    By Zdeno in forum Ext 5: Bugs
    Replies: 2
    Last Post: 9 Dec 2014, 9:48 PM
  4. Replies: 1
    Last Post: 16 Jul 2014, 9:47 AM

Tags for this Thread

Posting Permissions

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