Note that there are some explanatory texts on larger screens.

plurals
  1. POExtjs 4 gridrow draws blank after model save
    primarykey
    data
    text
    <p>I have a couple of grids, divided in an accordion layout. They basicly show the same kind of data so an grouped grid should do the trick, however it looks really good this way and so far it works good too.</p> <p>Left of the grids there is a form panel which is used to edit grid records, when I click on a record in the grid the appropriate data shows up in the form. I can edit the data, but when I click the save button, which triggers an 'model'.save() action, the related grid row draws blank and a dirty flag appears. I checked the model and the 'data' attribute doesn't contain any data but the id, the data is present in the 'modified' attribute.</p> <p>I read that the red dirty flag means that the data isn't persisted in the back-end, but in this case it is. The request returns with a 200 status code and success : true.</p> <p>The onSave method from the controller:</p> <pre><code>onSave : function() { // Get reference to the form var stepForm = this.getStepForm(); this.activeRecord.set( stepForm.getForm().getValues() ); this.activeRecord.save(); console.log( this.activeRecord ); } </code></pre> <p>The step store:</p> <pre><code>Ext.define( 'Bedrijfsplan.store.Steps', { extend : 'Ext.data.Store', require : 'Bedrijfsplan.model.Step', model : 'Bedrijfsplan.model.Step', autoSync : true, proxy : { type : 'rest', url : 'steps', reader : { type : 'json', root : 'steps' }, writer : { type : 'json', writeAllFields : false, root : 'steps' } } } ); </code></pre> <p>Step model:</p> <pre><code>Ext.define( 'Bedrijfsplan.model.Step', { extend : 'Ext.data.Model', fields : [ 'id', 'section_id', 'title', 'information', 'content', 'feedback' ], proxy : { type : 'rest', url : 'steps', successProperty : 'success' } } ); </code></pre> <p>Step grid</p> <pre><code>Ext.define( 'Bedrijfsplan.view.step.Grid', { extend : 'Ext.grid.Panel', alias : 'widget.stepsgrid', hideHeaders : true, border : false, columns : [ { header : 'Titel', dataIndex : 'title', flex : 1 } ] } ); </code></pre> <p>I spend a couple of hours searching and trying, but I still haven't found the solution. Some help on this matter would be appreciated :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload