Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Jun 2007
    Posts
    44
    Vote Rating
    0
    GArrow is on a distinguished road

      0  

    Exclamation CellModel does not update record selection

    CellModel does not update record selection


    REQUIRED INFORMATION


    Ext version tested:
    • Ext 4.0.2 rev a
    • (Also multiple Ext 3.x)

    Browser versions tested against:
    • Firefox 6
    Description:
    • The cell selection model breaks the record access provided in the base Ext.selection.Model class.
    • It is convenient to be able to write code that handles processing selected records without having to inspect the selection model used and use the different methods provided.

    Steps to reproduce the problem:
    • Use the cell selection model on a grid
    • Attempt to access the selected record

    The result that was expected:
    • The selected record would be in the "selected" property
    • ...and returned by getSelection().

    The result that occurs instead:
    • The selected property is not updated

    Test Case:

    Code:
        selModel.getSelection();


    HELPFUL INFORMATION


    Debugging already done:
    • In 3.x this was handled somewhat differently, but in 4.x, the documentation and class hierarchy for CellModel indicates that this should work. It is not entirely clear what the developers intended to be the mechanism to support this, but it is easy to apply a fix.

    Possible fix:
    • Attach event handlers to a CellModel instance to update its selection
    Code:
    Ext.define('MyGrid', {
      extend: 'Ext.grid.Panel',
      constructor : function (config) {
        this.callParent([config]);
        this.getSelectionModel().on('select', function (selModel, record, row, column, options) {
          selModel.selected.clear();
          selModel.selected.add(record);
        });
        this.getSelectionModel().on('deselect', function (selModel, record, row, column, options) {
          selModel.selected.clear();
        });
      }
    });

  2. #2
    Sencha User
    Join Date
    Jun 2007
    Posts
    44
    Vote Rating
    0
    GArrow is on a distinguished road

      0  

    Question Related to EXTJSIV-3970

    Related to EXTJSIV-3970


    This issue seems to be related to EXTJSIV-3970, identified in another thread regarding cellmodel and the selectionchange & select events.

    Can the Sencha folks indicate the status of these issues? Collectively, they seem to make it very difficult to use cell-model grids the way they seem to be intended.

    I have noticed that (in 4.0.2a) the grid's select event will fire, despite the cell-model selection model in that grid not firing a select. This seems like it should be considered a bug, but is it?

    Should users entirely ignore all select/deselect/selectionchange in the model, and only use the event coming from the grid?

  3. #3
    Sencha User mono blaine's Avatar
    Join Date
    Jul 2008
    Location
    Turkey
    Posts
    123
    Vote Rating
    8
    mono blaine will become famous soon enough

      0  

    Default


    GArrow, I've added one more line to your fix. For now, you can add this override in your app's launch method:

    Code:
    Ext.util.Observable.observe(Ext.selection.CellModel, {
        select: function (selModel, record, row, column, options) {
            selModel.selected.clear();
            selModel.selected.add(record);
            selModel.lastSelected = record;
        },
    
        deselect: function (selModel, record, row, column, options) {
            selModel.selected.clear();
            selModel.lastSelected = null;
        }
    
    });
    I mentioned this problem in http://www.sencha.com/forum/showthre...th-a-CellModel. They say the bug has already been filed.

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,798
    Vote Rating
    834
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    dup of EXTJSIV-4320
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

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

  5. #5
    Sencha User
    Join Date
    Jun 2007
    Posts
    44
    Vote Rating
    0
    GArrow is on a distinguished road

      0  

    Lightbulb Modified workaround

    Modified workaround


    I found that the workaround code suggested had a slight flaw with handing undefined records in certain cases. This is a version that works for me. Changes in bold.

    Code:
    Ext.util.Observable.observe(Ext.selection.CellModel, {
      select: function (selModel, record, row, column, options) {
        selModel.selected.clear();
        if ( undefined !== record ) selModel.selected.add(record);
        selModel.lastSelected = record;
      },
      deselect: function (selModel, record, row, column, options) {
        selModel.selected.clear();
        selModel.lastSelected = undefined;
      }
    });

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi