Dissappearing Page Numbers

3 posts, 0 answers
  1. Dr.YSG
    Dr.YSG avatar
    210 posts
    Member since:
    Dec 2009

    Posted 20 Mar 2012 Link to this post

    I have a JSON remote data source that has 2379 rows (pageSize: 5). For a one second flash, I see page [1] as a button at the bottom of the grid, but then it dissapears, and my grid looks like pageable:false.

    The JSON is long, but here is the beginning:

    {"pageSize":2739,"results":[{"bbox":"SRID=4326;POLYGON((-70.684264 41.8879795,-70.6659898 41.8879795,-70.6659898 41.8741688,-70.684264 41.8741688,-70.684264 41.8879795))",


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Catalog Search</title>
        <script src="Kendo/jquery.min.js" type="text/javascript"></script>
        <script src="kendo/kendo.all.min.js" type="text/javascript"></script>
        <script src="Kendo/console.js" type="text/javascript"></script>
        <script src="SearchCatalog.js" type="text/javascript"></script>
        <link href="Styles/kendo.common.min.css" rel="stylesheet" type="text/css" />
        <link href="Styles/kendo.blueopal.min.css" rel="stylesheet" type="text/css" />
        <link href="Styles/SeachPageStyle.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <div>
            <select id="dropDownList">
                <option>Search</option>
            </select>
        </div>
        <p>
        </p>
        <div id="gridPane">
        </div>
        <script type="text/javascript">
            $(document).ready(function () {
                setup();
            });
        </script>
    </body>
    </html>

    var catalogData;
    var catalogGrid;
     
    function buildModel() {
        catalogData = new kendo.data.DataSource({
            type: "json",
            pageSize: 5,
            transport: {
                read: {
                    url: "http://ysg4206/CatalogService/CatalogService.svc/ViewBoston",
                    dataType: "json"
                }
            },
            schema: {
                data: "results"
            },
            error: function (e) {
                alert("data error happened: " + e)
            }
        });
    }
     
    function layout() {
        $("#dropDownList").kendoDropDownList({
            open: function (e) {
                doSearch()
            }
        });
     
        $("#gridPane").kendoGrid({
            pageable: true,
            scrollable: true,
            height: 250,
            dataSource: catalogData,
            columns: [{
                field: "idx",
                title: "ID"
            }, {
                field: "classification",
                title: "classification"
            }, {
                field: "creator",
                title: "creator"
            }, {
                field: "date",
                title: "date"
            }, {
                field: "elevation",
                title: "elevation"
            }, {
                field: "datum",
                title: "datum"
            }, {
                field: "size",
                title: "size"
            }, {
                field: "type",
                title: "type"
            }, {
                field: "description",
                title: "description"
            }, {
                field: "dirLocation",
                title: "dirLocation"
            }, {
                field: "distributor",
                title: "distributor"
            }, {
                field: "egplDate",
                title: "egplDate"
            }, {
                field: "handling",
                title: "handling"
            }, {
                field: "product",
                title: "product"
            }, {
                field: "bbox",
                title: "bbox"
            }, {
                field: "uniqID",
                title: "uniqID"
            }
    		]
        });
    }
     
    function setup() {
        buildModel();
        layout();
    }
    



  2. Dr.YSG
    Dr.YSG avatar
    210 posts
    Member since:
    Dec 2009

    Posted 20 Mar 2012 Link to this post

    Let me also add that I just downloaded the latest commercial zip files, and that all the data is there (If I do turn pageable: false and turn remove the pageSize from the datasource in the javascript file).
  3. Kendo UI is VS 2017 Ready
  4. Dr.YSG
    Dr.YSG avatar
    210 posts
    Member since:
    Dec 2009

    Posted 20 Mar 2012 Link to this post

    I am an idiot today. I found the answer in the Grid Walkthrough (which I read too fast).

            schema: {
                data: "results",
                total: "count"
            },

    Make sure you specify in the schema where to find the total amount (and don't call it pageSize, call it something else like count).



Back to Top