This is a migrated thread and some comments may be shown as answers.

Dissappearing Page Numbers

2 Answers 51 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dr.YSG
Top achievements
Rank 2
Dr.YSG asked on 20 Mar 2012, 06:35 PM
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 Answers, 1 is accepted

Sort by
0
Dr.YSG
Top achievements
Rank 2
answered on 20 Mar 2012, 06:38 PM
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).
0
Dr.YSG
Top achievements
Rank 2
answered on 20 Mar 2012, 06:47 PM
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).



Tags
Grid
Asked by
Dr.YSG
Top achievements
Rank 2
Answers by
Dr.YSG
Top achievements
Rank 2
Share this question
or