-1

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) {

                    });

            });  
MiBrock
  • 1,100
  • 1
  • 11
  • 22
sree
  • 17
  • 7

2 Answers2

2

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

defaultPageSize: 50,.

use this in pagination plugin...

user2794174
  • 60
  • 10
0

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

Community
  • 1
  • 1
MiBrock
  • 1,100
  • 1
  • 11
  • 22
  • i tried that it doesn't stood to my need....i have give given autoHeight:50,.....but it is srinking to 10....when i clicking on 25 it is expanding to 25 rows without scroll...when i click on 50 ...got scrolll bar.......at the first loading it is displaying only 10 rows why???????? @ MiBrock – sree Sep 17 '13 at 10:54
  • Updated my post - have a look – MiBrock Sep 17 '13 at 11:17