Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExtJS RowExpander plugin: expanded rows looses it's row body on grid refresh (with enableCaching: false) #13991

Closed
gadgetto opened this issue Jul 12, 2018 · 2 comments · Fixed by #13992

Comments

@gadgetto
Copy link

gadgetto commented Jul 12, 2018

Summary

We have a MODX grid with rowExpander plugin enabled and enableCaching: false. If row is expanded and the grid is refreshed, the expanded row seems to collapse but the [+] sign stays at [-]. You then have to click the [-] and then the [+] to re-expand the row.

This problem is also related to: #13989

Step to reproduce

Setup a MODX grid and create a rowExpander:

    // Content of the expanded grid row
    var nlInfos = [
        '<table id="gon-nlinfo-{id}" class="gon-expinfos">',
            '<tr>',
                '<td class="gon-expinfos-key">'+_('goodnews.id')+'</td><td class="gon-expinfos-val">{id}</td>',
                '<td class="gon-expinfos-key">'+_('goodnews.newsletter_createdon')+'</td><td class="gon-expinfos-val">{createdon_formatted}</td>',
                '<td class="gon-expinfos-key">'+_('goodnews.newsletter_publishedon')+'</td><td class="gon-expinfos-val">{publishedon_formatted}</td>',
                '<td class="gon-expinfos-key">'+_('goodnews.newsletter_sender')+'</td><td class="gon-expinfos-val">{sentby_username}</td>',
                '<td class="gon-expinfos-key">'+_('goodnews.newsletter_scheduled')+'</td><td class="gon-expinfos-val gon-scheduled">{pub_date_formatted}</td>',
            '</tr>',
        '</table>'
        ].join('\n');

this.exp = new Ext.ux.grid.RowExpander({
    tpl: new Ext.Template(nlInfos)
    ,enableCaching: false
});

Please note: if you set enableCaching: true it works as expected - except that the fields in the expanded row aren't updated!

Bind it to the MODX grid:

        ...
        ,plugins: [this.exp]
        ,columns: [
        this.exp
        ,{
            header: _('goodnews.id')
            ,dataIndex: 'id'
            ,hidden: true
        ...

Observed behavior

If row is expanded and the grid is refreshed, the expanded row seems to collapse.

Expected behavior

The row should stay expanded on grid refresh and the expanded content should be refreshed too.

Environment

MODX version: 2.6.4-pl
Browser: tested in Safari and Chrome

@gadgetto gadgetto changed the title ExtJS RowExpander plugin: expanded rows looses it's row body on grid refresh ExtJS RowExpander plugin: expanded rows looses it's row body on grid refresh (with enableCaching: false) Jul 12, 2018
@alroniks
Copy link
Collaborator

Hi @gadgetto
Did you try also set lazyRender to false? I tried and all works fine for me. Please, try and confirm.
It seems that it is not an issue and can be closed.

@gadgetto
Copy link
Author

Ohh my... had this bug sind the beginning of add-on. This definitely fixes it! Thanks! I'm closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants