Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

156
Vistas
cannot read properties of null (reading 'insertAdjacentHTML') while updating the store

Cannot read properties of null (reading 'insertAdjacentHTML') while updating the store.

I am trying to update my store manually by changing some data.

Here is my code.

updateFieldData: function (selectedDRecord) {
        if (selectedDRecord.id != undefined || selectedDRecord.id != null) {
            let _this = this;
            let groupkey = sessionStorage.getItem('groupKey');
            var rowExapnaderGridData = Ext.ComponentQuery.query('#' + groupkey)[0].getStore();    // this is my gridstore
            var tempStore = [];
            var salesRowData = rowExapnaderGridData.getData().items;
            for (var i = 0; i < salesRowData.length; i++) {
                tempStore.push(salesRowData[i].data);
            }
            for (var i = 0; i < tempStore.length; i++) {
               tempStore[i].value = "somevalue";
            }
            rowExapnaderGridData.loadData(tempStore);
        }

    },

This is working fine while creating but when I am updating I am getting the following error.

Uncaught TypeError: Cannot read properties of null (reading 'insertAdjacentHTML')
    at ctor.insertHtml (ext-all.js?_dc=1654269040829:20:911890)
    at ctor.doInsert (ext-all.js?_dc=1654269040829:20:481469)
    at ctor.append (ext-all.js?_dc=1654269040829:20:481393)
    at ctor.refresh (ext-all.js?_dc=1654269040829:20:1600777)
    at ctor.refresh (ext-all.js?_dc=1654269040829:20:1619324)
    at ctor.refresh (ext-all.js?_dc=1654269040829:20:1862004)
    at ctor.refreshView (ext-all.js?_dc=1654269040829:20:1609433)
    at ctor.onDataRefresh (ext-all.js?_dc=1654269040829:20:1609149)
    at ctor.onDataRefresh (ext-all.js?_dc=1654269040829:20:1870226)
    at ctor.fire (ext-all.js?_dc=1654269040829:20:153709)

I have checked in other places but didn't get much support w.r.t.ExtJS.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The code can be simplified like this:

if (!Ext.isEmpty(selectedDRecord.id)) {
   const groupkey = sessionStorage.getItem('groupKey'),
         rowExpanderGridData = Ext.ComponentQuery.query('#' + groupkey)[0].getStore();
   
   Ext.each(rowExpanderGridData, function(record) {
       record.set('fieldname', 'some value'); //'fieldname' is the field that you want to change; 'some value' the new value for it
   });

   rowExpanderGridData.commitChanges();
}
   

Alternatively, you could create a new models array and load them in the store using loadRecords().

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda