Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/447.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
Javascript 网格上的Bug停靠摘要_Javascript_Extjs_Datagrid_Extjs6_Dock - Fatal编程技术网

Javascript 网格上的Bug停靠摘要

Javascript 网格上的Bug停靠摘要,javascript,extjs,datagrid,extjs6,dock,Javascript,Extjs,Datagrid,Extjs6,Dock,这是我的第一个问题,我会尽量准确 我将我的应用程序从ExtJS 6.2更新到ExtJS 6.5,发现了一个bug:在网格中,摘要在停靠时无法正常工作 我创建了一个展示这个问题的网站,我请求官方支持网站,他们会试图找到一个解决方案,同时我必须自主解决我的问题 我可以降级到ExtJS 6.2,但即使使用该版本,也有几个bug需要解决,所以我更喜欢使用最新版本 所以,问题是:有没有人有同样的问题?我听说这是一个回归,因为它是在4.5版或类似的版本中解决的,但我对这个框架非常陌生(也就是说,我一个月前才

这是我的第一个问题,我会尽量准确


我将我的应用程序从ExtJS 6.2更新到ExtJS 6.5,发现了一个bug:在网格中,摘要在停靠时无法正常工作

我创建了一个展示这个问题的网站,我请求官方支持网站,他们会试图找到一个解决方案,同时我必须自主解决我的问题

我可以降级到ExtJS 6.2,但即使使用该版本,也有几个bug需要解决,所以我更喜欢使用最新版本

所以,问题是:有没有人有同样的问题?我听说这是一个回归,因为它是在4.5版或类似的版本中解决的,但我对这个框架非常陌生(也就是说,我一个月前才开始使用ExtJS)

你能给我一个解决方法,任何有用的,调试的起点吗


我没有太多时间来完成应用程序,任何建议都将不胜感激(例如,我应该尝试调试摘要还是开始开发自定义组件?

同样的问题,在grid reconfigure事件之后似乎没有触发datachange事件

将此项添加到网格以确认:

listeners: {
    reconfigure: function(grid, store) {
          store.fireEvent('datachanged', store);
    }
},
试试这个覆盖

Ext.define('Ext.grid.feature.Summary', {
override: 'Ext.grid.feature.Summary',
afterHeaderCtLayout: function (headerCt) {
    var me = this,
        view = me.view,
        columns = view.getVisibleColumnManager().getColumns(),
        column,
        len = columns.length, i,
        summaryEl,
        el, width, innerCt;

    if (me.showSummaryRow && view.refreshCounter) {
        if (me.dock) {
            summaryEl = me.summaryBar.el;
            width = headerCt.getTableWidth();
            innerCt = me.summaryBar.innerCt;
            //if summary is docked item getAll available columns.
            columns = view.getColumnManager().getColumns();
            len = columns.length;
            // Stretch the innerCt of the summary bar upon headerCt layout
            me.summaryBar.item.setWidth(width-1);

            // headerCt's tooNarrow flag is set by its layout if the columns overflow.
            // Must not measure+set in after layout phase, this is a write phase.
            if (headerCt.tooNarrow) {
                width += Ext.getScrollbarSize().width;
            }
            innerCt.setWidth(width-1);
        } else {
            summaryEl = Ext.fly(Ext.fly(view.getNodeContainer()).down('.' + me.summaryItemCls, true));
        }
        // If the layout was in response to a clearView, there'll be no summary element
        if (summaryEl) {
            for (i = 0; i < len; i++) {
                column = columns[i];
                el = summaryEl.down(view.getCellSelector(column), true);
                var colWidth = column.getWidth(),
                    display = column.hidden ? "none" : 'table-cell';
                if (el) {
                    Ext.fly(el).setWidth(colWidth||column.width || (column.lastBox ? column.lastBox.width : 100));
                } else if (me.dock) {
                    //if docked summary and cell does not exists in docked summaryBar then create new cell for that column
                    var row = me.summaryBar.item.dom.rows[0];
                    if (row) {
                        row.insertCell(i);
                        var newCell = row.cells[i];
                        if (newCell) {
                            //apply cell class and columnId attributes for newly added cells.
                            var columnId = column.id;
                            newCell.setAttribute('class', 'x-grid-cell x-grid-td x-grid-cell-' + columnId + ' x-unselectable');
                            newCell.setAttribute('data-columnid', columnId);
                            el = summaryEl.down(view.getCellSelector(column), true);
                            if (el) {
                                //set the column width to cell.
                                Ext.fly(el).setWidth(colWidth || column.width || (column.lastBox ? column.lastBox.width : 100));
                            }
                        }
                    }
                }
                if (me.dock&&el) {
                    //show/hide summary cells based on column status.
                    el.style.display = display;
                }
            }
        }
    }
}
Ext.define('Ext.grid.feature.Summary'{
覆盖:“Ext.grid.feature.Summary”,
afterHeaderCtLayout:功能(headerCt){
var me=这个,
view=me.view,
columns=view.getVisibleColumnManager().getColumns(),
专栏,
len=列数。长度,i,
summaryEl,
el,宽度,内CT;
if(me.showSummaryRow&&view.refreshCounter){
如果(我的码头){
summaryEl=me.summaryBar.el;
宽度=headerCt.getTableWidth();
innerCt=me.summaryBar.innerCt;
//如果摘要是停靠项,则获取所有可用列。
columns=view.getColumnManager().getColumns();
len=列数。长度;
//根据headerCt布局拉伸摘要栏的内部CT
me.summaryBar.item.setWidth(宽度-1);
//如果列溢出,headerCt的Too窄标志由其布局设置。
//布局阶段后不得测量+设置,这是写入阶段。
如果(车头狭窄){
宽度+=Ext.getScrollbarSize().width;
}
内部CT设置宽度(宽度-1);
}否则{
summaryEl=Ext.fly(Ext.fly(view.getNodeContainer()).down('..+me.summaryItemCls,true));
}
//如果布局是对clearView的响应,那么就不会有摘要元素
if(summaryEl){
对于(i=0;i

}))

“在网格中,摘要停靠时无法正常工作”你能更具体一点吗?嗨,我有一个带有摘要的网格。当我将属性“docked”设置为true时,整个过程停止工作:总和的值错误,单元格不显示/隐藏到它们的列中。如果您查看fiddle(),您将立即发现问题所在,事实上,示例中两个网格的代码是相同的,除了摘要功能上的“dock”标志。