Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8642087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:41:19+00:00 2026-06-12T11:41:19+00:00

I have a simple case where I got a grid with an attached store.

  • 0

I have a simple case where I got a grid with an attached store.

There are 2 buttons. One with a handler that modifies the selected record. One with a handler that commits the selected record.

When I select a record and push edit -> editing takes place selection (looks lost) if you call grid.geSelectionModel().getSelection() you will see that the record is still selected. It just doesn’t show it that way.

You can’t select it again, you first have to select another record, and select the record back.

Secondly when you select a record click on the commit button, the value is committed, but the selection ‘appears’ again as lost.

Is this a bug? How can I fix this? I want it to keep the selection visible!

Here is a fiddle

and here is the sample code: (I use Ext 4.1.1)

var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
        clicksToEdit: 1
    });

Ext.create('Ext.data.Store', {
    storeId: 'simpsonsStore',
    fields: ['name', 'email', 'phone'],
    data: {
        'items': [{
            'name': 'Lisa',
            "email": "lisa@simpsons.com",
            "phone": "555-111-1224"
        }, {
            'name': 'Bart',
            "email": "bart@simpsons.com",
            "phone": "555-222-1234"
        }, {
            'name': 'Homer',
            "email": "home@simpsons.com",
            "phone": "555-222-1244"
        }, {
            'name': 'Marge',
            "email": "marge@simpsons.com",
            "phone": "555-222-1254"
        }]
    },
    proxy: {
        type: 'memory',
        reader: {
            type: 'json',
            root: 'items'
        }
    }
});

Ext.create('Ext.container.Container', {
    layout: 'fit',
    renderTo: Ext.getBody(),
    items: [{
        xtype: 'grid',
        store: Ext.data.StoreManager.lookup('simpsonsStore'),
        columns: [{
            text: 'Name',
            dataIndex: 'name'
        }, {
            text: 'Email',
            dataIndex: 'email',
            flex: 1
        }, {
            text: 'Phone',
            dataIndex: 'phone'
        }],
        height: 200,
        buttons: [{
            text: 'commit selection',
            handler: function(){
                this.up('grid').getSelectionModel().getSelection()[0].commit();
            }
        },{
            text: 'set selection name to maggy',
            handler: function(){
                this.up('grid').getSelectionModel().getSelection()[0].set('name', 'Maggy');
            }
        }]
    }]
});​

UPDATE:

I reported it on the sencha forum. Mitchel Simoens told me it’s fixed in Ext 4.1.2. Too bad it’s a ‘Support subscriber only’ version..

UPDATE:

I’m locating the issue to try and fix it. I believe the issue is located in the Ext.view.Table class in onUpdate method, more precise around this piece of code:

if (oldRowDom.mergeAttributes) {
    oldRowDom.mergeAttributes(newRow, true);
} else {
    newAttrs = newRow.attributes;
    attLen = newAttrs.length;
    for (i = 0; i < attLen; i++) {
        attName = newAttrs[i].name;
        if (attName !== 'id') {
           oldRowDom.setAttribute(attName, newAttrs[i].value);
        }
    }
}

Is it a bad idea to just leave this piece of code out? I commented it out it seems like it’s working now, but won’t it break some other functionality? http://jsfiddle.net/Vandeplas/YZqch/10/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:41:20+00:00Added an answer on June 12, 2026 at 11:41 am

    I think its a bug, maybe as part of refreshing the grid to show the dirty bits.
    I circumvented this in an ugly way, in your revised fiddle:

    {
        text: 'set selection name to maggy',
        handler: function(){
            var sel = this.up('grid').getSelectionModel();
            var rec = sel.getSelection()[0];
            rec.set('name', 'Maggy');
            sel.deselectAll();
            sel.select(rec.index);
        }
    }
    

    I did this for .set(), but the same can be done for commit()

    Hope this helps somewhat.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple test case failing in Django: Model (app/models.py): from django.db import
I have a pretty simple case which I started solving using foreach(), but then
I have a simple unit test case (extensive question here ) on a configuration
What is good design in this simple case: Let's say I have a base
I have simple php validation form that is halfway working. If you leave the
I have simple database - one table with 6 collumns. 3 of them i
I have got an simple html unordered list. <ul> <li>Item 1</li> <li> Group 1
I have got a piece of regex ([A-Z]|_)* to find upper case values of
I've got a vey simple form with a grid of 16 labels, each of
A really simple question here. I have a label on one view and a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.