Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

152
Visualizações
Strange behavior of Ext.JS stores with paging and grids

I had some strange behavior of the stores in ext.js, when I was working with grids and with pagination. Problem: I have a grid, a store with pagination is attached to it. When removing a row from the grid, the row from the next page does not get to the current one. I tried reload store, commitChanges(), refresh(), pagingToolbar.doRefresh() and other things, but i just get the deleted row back into the grid.

I have Ext.JS 5.1.0.107.

I've reproduced this bug on Sencha's fiddle so you can see live example: https://fiddle.sencha.com/#fiddle/3ia0

Source code of reproducing the problem:

var store = Ext.create('Ext.data.Store', {
    fields: ['name', 'email', 'phone'],
    pageSize: 5,
    proxy: {
        enablePaging: true,
        type: 'memory'
    },
    data: [{
        name: 'Lisa 1',
        email: 'lisa@simpsons.com',
        phone: '555-111-1224'
    }, {
        name: 'Bart 2',
        email: 'bart@simpsons.com',
        phone: '555-222-1234'
    }, {
        name: 'Homer 3',
        email: 'homer@simpsons.com',
        phone: '555-222-1244'
    }, {
        name: 'Marge 4',
        email: 'marge@simpsons.com',
        phone: '555-222-1254'
    }, {
        name: 'Bart 5',
        email: 'bart@simpsons.com',
        phone: '555-222-1234'
    }, {
        name: 'Homer 6',
        email: 'homer@simpsons.com',
        phone: '555-222-1244'
    }, {
        name: 'Marge 7',
        email: 'marge@simpsons.com',
        phone: '555-222-1254'
    }]
});

var grid = Ext.create('Ext.grid.Panel', {
    title: 'Simpsons',
    store: store,
    columns: [{
        text: 'Name',
        dataIndex: 'name'
    }, {
        text: 'Email',
        dataIndex: 'email',
        flex: 1
    }, {
        text: 'Phone',
        dataIndex: 'phone'
    }, {
        xtype: 'actioncolumn',
        text: 'delete',
        width: 50,
        items: [{
            icon: 'https://img.icons8.com/material-outlined/72/filled-trash.png',
            tooltip: 'Delete',
            handler: function (_, rowIndex) {
                var elem = grid.getStore().getAt(rowIndex);
                grid.getStore().remove(elem);
                grid.dockedItems.getAt(2).doRefresh();
            }
        }]
    }],
    height: 500,
    width: 500,
    renderTo: Ext.getBody(),
    dockedItems: [{
        xtype: 'pagingtoolbar',
        reference: 'pagingToolbar',
        displayMsg: '',
        flex: 1,
        store: store,
        dock: 'bottom'
    }]
});
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda