tags:

views:

23

answers:

1

im currently implementing remote grouping in grid panel. it works gine when i click on group by this feild. But whn i click on show in groups how do i clear grouping. It is currently noe clearing the groups HERE is my code when i click on show in groups the group filed is being sent to server side.

var store = new FMP.AspNetJsonStore({ fields: [

                       { name: 'Image' },
                       { name: 'StatusName' },
                       { name: 'Incident' },
                       { name: 'ModelName' },
                       { name: 'PrinterSerialNumber' },
                       { name: 'InScope' },
                       { name: 'Black', type: 'float' },
                       { name: 'Cyan', type: 'float' },
                       { name: 'Magenta', type: 'float' },
                       { name: 'Yellow', type: 'float' },
                       { name: 'ManufacturerName' },
                       { name: 'CustomerChargeBackEntryName' },
                       { name: 'PageCount' },
                       { name: 'BlackImpressions' },
                       { name: 'ColorImpressions' },
                       { name: 'PrinterIPAddress' },
                       { name: 'Customer' },
                       { name: 'AssetID' },
                       { name: 'PricePlanID' },
                       { name: 'CanManage' },
                       { name: 'ColorCapable' },
                       { name: 'PrinterMarkerSupplies' },
                       { name: 'IPAddressToLong' },
                       { name: 'ResponsibilityForAction' }

                    ],

        totalProperty: "TotalCount",



        proxy: new Ext.ux.AspWebServiceProxy(
       {
           webServiceProxy: GetPrintersGrid,
           webServiceProxyMethod: GetPrintersGrid.buildGrid

       }),

        //sortInfo: { field: 'PageCount', direction: "DESC" },
        remoteSort: true,
        remoteGroup: true,
        //groupOnSort: false,

        groupField: 'Customer',
        root: 'Records'
    });
A: 

it is only deleting the group filed parameter and not group direction. so i overrided cleargrouping. but then when i check the checkbox it is not getting the values of group filed and group direction(they are empty as i deleted them in cleargrouping) so i overrided applygrouping to reassign the values How to assign the value of group field?

Ext.override(Ext.data.GroupingStore, {

    clearGrouping: function() {
        this.groupField = false;
        if (this.remoteGroup) {
            if (this.baseParams) {
                this.baseParams.groupBy = " ";
                this.baseParams.groupDir = " ";
            }
            var lo = this.lastOptions;
            if (lo && lo.params) {
                lo.params.groupBy = " ";
                lo.params.groupDir = " ";
            }
            this.reload();
        } else {
            this.applySort();
            this.fireEvent('datachanged', this);
        }
    },

 applyGrouping: function(alwaysFireChange) {
    if (this.groupField !== false) {
        this.groupBy(this.groupField, true, this.groupDir);
        return true;
    } 
    else if (this.groupField == false && this.baseParams.groupBy == " " &&  this.baseParams.groupDir == " " && this.lastOptions.params.groupBy == " " && this.lastOptions.params.groupDir == " ") {
    this.baseParams.groupBy = this.grid.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));
    this.baseParams.groupDir = this.groupDir;
    this.lastOptions.params.groupBy = this.groupField;// what should be the value of the group feild???
    this.lastOptions.params.groupDir = this.groupDir;
    this.groupBy(this.groupField, true, this.groupDir);
        return true;
    }
    else if (this.groupField == false && this.baseParams.groupBy !== " " &&  this.baseParams.groupDir !== " " && this.lastOptions.params.groupBy !== " " && this.lastOptions.params.groupDir !== " ") {
                 if (alwaysFireChange === true) {
            this.fireEvent('datachanged', this);
        }
        return false;
    }
}
});
xrx215