-1

I have jqxgrid.I am very new to jqxgrid.I want to display total of recordes or values in column. Can any tell me how to do enter image description here

veena hosur
  • 147
  • 2
  • 10

1 Answers1

0

jqxgrid have feature to show aggregates for some column, that aggregates could be 'SUM', 'COUNT', or 'AVERAGE'

you can set the aggregates types when u set the column setting in jqxgrid declaration.

for simple example is like this :

// initialize jqxGrid
        $("#jqxgrid").jqxGrid(
        {
            width: 850,
            source: dataAdapter,     
            showstatusbar: true,
            statusbarheight: 50,
            showaggregates: true,
            columns: [
              { text: 'First Name', columntype: 'textbox', datafield: 'firstname', width: 170 },
              { text: 'Last Name', datafield: 'lastname', columntype: 'textbox', width: 170 },
              { text: 'Price', datafield: 'price', cellsalign: 'right', cellsformat: 'c2', aggregates: ['sum', 'avg'] }
            ]
        });

for custom aggregates, u can learn from this link http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/aggregates.htm?arctic

for complete documentation for aggregates please check the API's documentation from their documentation.

hope this helps

Ivan
  • 96
  • 2
  • 8
  • according to your suggestion I have changed my code but i am getting $ symbol in that particular column.I have attached snap shot please check above and tell me how to remove it – veena hosur Feb 02 '16 at 10:36
  • in the column setting for 'Samples Collected', change the 'cellsformat' to 'c2', for another cellsformat check their documentation. – Ivan Feb 02 '16 at 12:39
  • It's c2 only eventhough I am getting $ – veena hosur Feb 02 '16 at 12:52
  • may be its related with currency setting in windows regional setting, but we can set it also. we can do this using localization. u can learn about the localization here => https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-localization.htm fill blank space in localizationobj.currencysymbol – Ivan Feb 02 '16 at 13:11