Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
单击Extjs Grid RowExpander时出现滚动问题_Extjs_Extjs6 Classic_Extjs Grid - Fatal编程技术网

单击Extjs Grid RowExpander时出现滚动问题

单击Extjs Grid RowExpander时出现滚动问题,extjs,extjs6-classic,extjs-grid,Extjs,Extjs6 Classic,Extjs Grid,我在使用extjs grid rowexpander时遇到了一个问题。 复制它的步骤: 1.展开第一行。 2.现在滚动到网格的最后一条记录。 3.现在展开最后一行。您将看到滚动条自动移动到顶部 谢谢你的帮助 Ext.create('Ext.grid.Panel', { margin: '30 2 0 0', layout: 'fit', scrollable: 'vertical', cls: 'logTimeInTask', bodyCls: 'scro

我在使用extjs grid rowexpander时遇到了一个问题。 复制它的步骤: 1.展开第一行。 2.现在滚动到网格的最后一条记录。 3.现在展开最后一行。您将看到滚动条自动移动到顶部

谢谢你的帮助

Ext.create('Ext.grid.Panel', {
    margin: '30 2 0 0',
    layout: 'fit',
    scrollable: 'vertical',
    cls: 'logTimeInTask',
    bodyCls: 'scrollBar',
    renderTo:Ext.getBody(),
    maxHeight: 400,
    title: 'timeEntryDetail',
    scrollable: true,
    collapsible: false,
    columnLines: false,
    expandOnDblClick: false,
    viewConfig: {
        preserveScrollOnRefresh: true,
        preserveScrollOnReload: true
    },
    columns: [{
        text: 'timeLoggedBy',
        menuDisabled: true,
        sortable: false,
        flex: 1,
        renderer: function (value, p, record) {
            var retDataStr = '';
            retDataStr += Ext.String.format('<span>{0}</span>', record.data.creator);
            return retDataStr
        }
    }, {
        text: 'time',
        sortable: false,
        menuDisabled: true,
        width: 120,
        renderer: function (value, p, record) {
            var retDataStr = '';
            if (record.data.logged_hours != null) {
                retDataStr += record.data.logged_hours + 'h ';
            }
            if (record.data.logged_mins != null) {
                retDataStr += record.data.logged_mins + 'm ';
            }
            return retDataStr;
        }
    }, {
        text:'date',
        sortable: false,
        menuDisabled: true,
        width: 100,
        renderer: function (value, p, record) {
            return record.data.date;
        }
    }, {
        text: 'status',
        sortable: false,
        menuDisabled: true,
        dataIndex: 'status',
        width: 120,
        renderer: function (value, p, record) {
            return Ext.String.capitalize(record.data.status);
        }

    }],
    plugins: [{
        ptype: 'rowexpander',
        rowBodyTpl: new Ext.XTemplate(
            '<p><b>timesheet:</b> {timesheet}</p>',
            '<tpl if="description!=null">',
            '<p><b>description:</b> {[this.showDescription(values)]}</p>',
            '</tpl>', {
                showDescription: function (values) {
                    return values.description;
                }
            }
        )
    }],
    listeners: {
        render: function (grid) {
                var timeEntryDetailStore = new Ext.data.JsonStore({
                    data: [{"id":80930195009,"status":"none","description":"dfsgdfsgsd\nfg\ndsf\ng\ndsf\ng\nsdfg\nsdfg","date":"2017-07-17","created_at":"2017-07-17T09:38:32+00:00","logged_hours":3,"logged_mins":54,"timer":false,"timesheet":"111111111111","task_id":14763865922,"sort":0,"project":909679456,"project_name":"wwwwwwwwwwwwwww","creator":1270919337},{"id":80930208578,"status":"none","description":"dsfv dfd sfg\ndsf \ng\ndfsg \ndfsg\n\ndsg\nds\ng\ndfs\ngdsfg\n dfg","date":"2017-07-17","created_at":"2017-07-17T09:39:04+00:00","logged_hours":12,"logged_mins":4,"timer":false,"timesheet":"111111111111","task_id":14763865922,"sort":0,"project":909679456,"project_name":"wwwwwwwwwwwwwww","creator":1270919337},{"id":80930222146,"status":"none","description":"So the problem here is whenever we open a popup window ExtJS library is needed and it is taking up a lot of memory in IE.\n\nIs there any other way we can load a browser window popup with ExtJS grid without loading the whole ExtJS framework?\n\nOr any other idea are most welcome, as we are really facing a lot of memory issues in IE and users are not willing to use chrome.","date":"2017-07-17","created_at":"2017-07-17T09:39:38+00:00","logged_hours":4,"logged_mins":3,"timer":false,"timesheet":"111111111111","task_id":14763865922,"sort":0,"project":909679456,"project_name":"wwwwwwwwwwwwwww","creator":1270919337},{"id":80930235715,"status":"none","description":"So the problem here is whenever we open a popup window ExtJS library is needed and it is taking up a lot of memory in IE.\n\nIs there any other way we can load a browser window popup with ExtJS grid without loading the whole ExtJS framework?\n\nOr any other idea are most welcome, as we are really facing a lot of memory issues in IE and users are not willing to use chrome.","date":"2017-07-17","created_at":"2017-07-17T09:39:44+00:00","logged_hours":3,"logged_mins":54,"timer":false,"timesheet":"111111111111","task_id":14763865922,"sort":0,"project":909679456,"project_name":"wwwwwwwwwwwwwww","creator":1270919337},{"id":80930249284,"status":"none","description":"So the problem here is whenever we open a popup window ExtJS library is needed and it is taking up a lot of memory in IE.\n\nIs there any other way we can load a browser window popup with ExtJS grid without loading the whole ExtJS framework?\n\nOr any other idea are most welcome, as we are really facing a lot of memory issues in IE and users are not willing to use chrome.","date":"2017-07-17","created_at":"2017-07-17T09:39:50+00:00","logged_hours":39,"logged_mins":2,"timer":false,"timesheet":"111111111111","task_id":14763865922,"sort":0,"project":909679456,"project_name":"wwwwwwwwwwwwwww","creator":1270919337},{"id":80930262852,"status":"none","description":"So the problem here is whenever we open a popup window ExtJS library is needed and it is taking up a lot of memory in IE.\n\nIs there any other way we can load a browser window popup with ExtJS grid without loading the whole ExtJS framework?\n\nOr any other idea are most welcome, as we are really facing a lot of memory issues in IE and users are not willing to use chrome.","date":"2017-07-17","created_at":"2017-07-17T09:39:57+00:00","logged_hours":3,"logged_mins":54,"timer":false,"timesheet":"111111111111","task_id":14763865922,"sort":0,"project":909679456,"project_name":"wwwwwwwwwwwwwww","creator":1270919337}]
                });
                grid.setStore(timeEntryDetailStore);

        }
    }
})

我已经将您的示例粘贴到Sencha小提琴中,虽然这在6.0.0到6.0.2中发生,但在6.2.0到6.5.0中似乎是固定的

因此,我将代码与不工作的源代码进行了比较,发现了变化。这里有一个适用于您的工作覆盖:

Ext.define('Override.RowExpander',{
    override:'Ext.grid.plugin.RowExpander',
    toggleRow: function(rowIdx) {
        this.callParent(arguments);
        this.grid.ensureVisible(rowIdx);
    }
});

你能提供小提琴样品吗?如果没有网格数据,它怎么能被复制?@harshitsah你可以用senchafiddle粘贴上面的代码。请仔细检查网格数据的代码。