javascript - Ext GroupingView is not working simply listing the rows without grouping -
i trying use ext groupingview listing rows without grouping code groupingstore:
//......................................................// _store = new ext.data.groupingstore({ autodestroy: true, proxy: new ext.data.memoryproxy({ items: [] }), remotesort: true, grouponsort: true, sortinfo: { field: 'xxxexamprofg', direction: "asc" }, groupfield: 'xxxexamprofg', reader: new yyy.xxxexamdetjsonreader() }); _gridpanel = new yyy.xxxexamdetgridpanel(ext.copyto({ id: _this.id + '-gridpaneld', store: _store, }, _this.initialconfig, [])); ext.apply(_this, { onrender: function(ct, position) { yyy.xxxexamdetlistfield.superclass.onrender.call(_this, ct, position); _this.wrap = _this.el.wrap({ cls: 'x-form-field-wrap' }); _this.resizeel = _this.positionel = _this.wrap; _gridpanel.render(_this.wrap); }, //......................................................// setvalue: function(v) { _gridpanel.getstore().proxy.data.items = v; _gridpanel.getstore().load(); return yyy.xxxexamdetlistfield.superclass.setvalue.apply(_this, arguments); }, getvalue: function() { return _gridpanel.getstore().proxy.data.items; } });
and code gridpanel:
yyy.xxxexamdetgridpanel = ext.extend(ext.grid.gridpanel, { border: false, initcomponent: function() { this.colmodel = new ext.grid.columnmodel({ defaults: { width: 100, sortable: true }, view: new ext.grid.groupingview({ forcefit: true, // custom grouping text template display number of items per group grouptexttpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "items" : "item"]})' }), columns: [ { dataindex: 'fservice', header: 'exam code', xtype: 'gridcolumn' }, { dataindex: 'xxxexamprofgdescr', header: 'xxxexamprofgdescr', xtype: 'gridcolumn' }, { dataindex: 'xxxexamprofg', header: 'xxxexamprofg', xtype: 'gridcolumn' }, { dataindex: 'fedate', header: 'date', xtype: 'datecolumn', format: 'd/m/y' } ] }); yyy.xxxgridpanel.superclass.initcomponent.apply(this, arguments); } //initcomponent }); ext.reg('yyy.xxxexamdetgridpanel', yyy.xxxdetgridpanel);
i trying figure out why listing rows without group them or way debug ?
you have placed groupingview inside columnmodel. instead should assign this.view
assign columnmodel this.colmodel
.
this example of why indentation matters - mistake have been clear bit experienced.
Comments
Post a Comment