Question

i have 100000 data in my grid at first request it showing only 10 after clicking on the page selecter it showing next data............plz answer why enhanced grid displaying only 10 rows at first time

require([ "dojo/_base/lang","dojox/grid/EnhancedGrid",
          "dojox/grid/enhanced/plugins/Pagination","dojo/data/ItemFileReadStore",
          "dijit/form/Button","dojo/request/xhr", "dojo/dom",
          "dojo/dom-construct", "dojo/json", "dojo/on", "dojox/grid/cells/dijit",
          "dojo/domReady!" ],

    function(lang,EnhancedGrid,Pagination,ItemFileReadStore,Button,xhr, dom, domConst, JSON, on) {
            xhr("myservernameaddress/GridExample/string", {
                handleAs : "json"
            }).then(
                    function(dataa) {


                    /*  domConst.place("<p>response: <code>"
                                + JSON.stringify(dataa) + "</code></p>",
                                "output"); */

                                /* domConst.place("<p>response: <code>"
                                        + JSON.stringify(dataa) + "</code></p>",
                                        "output"); */

                        var mydata=dataa;

                         var yourStore = new dojo.data.ItemFileReadStore({
                                data: {
                                    identifier: "sno",
                                   /* items: mydata.aa */
                                   items:mydata
                                 }
                            });

                        grid = new EnhancedGrid({
                            store : yourStore,
                            selectable:true,
                            query : {
                                sno : "*"
                            },
                            structure : [  {
                                name : "SNO",
                                field : "sno",
                                width : "100px"
                            },{
                                name : "SNAME",
                                field : "sname",
                                width : "100px",
                                editable:true
                            },{
                                name : "SALARY",
                                field : "salary",
                                width : "200px",
                                editable:true
                            } ],
                            rowSelector: '20px',
                             plugins: {
                                pagination: {
                                    pageSizes: ["25","50","100"],
                                    description: true,
                                    sizeSwitch: true,
                                    pageStepper: true,
                                    gotoButton: true,
                                    maxPageStep: 2,
                                    position: "bottom",
                                    search:true

                                }
                            }
                        });
                        grid.placeAt("myGrid");
                        grid.startup();                 

                    }, function(err) {
                        alert("error");
                    }, function(evt) {

                    });

            });  
Was it helpful?

Solution

can avoid enhanced grid default 10 rows size by this please check it

defaultPageSize: 50,.

use this in pagination plugin...

OTHER TIPS

I think this might help you out: When you define your grid you can set autoHeight

I've copied this from dojo:

autoHeight

If true, automatically expand grid’s height to fit data. If numeric,
defines the maximum rows of data displayed (if the grid contains 
less than autoHeight rows, it will be shrunk).

For more informations have a look : http://dojotoolkit.org/reference-guide/1.7/dojox/grid/DataGrid.html#datagrid-options

Update1

Maybe this former Post makes it clearer: DataGrid's rowsPerPage attribute not working

Regards, Miriam

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top