Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    TileGrid with datasource does request all item

    Hi there,
    after implementing the datasource in the tilegrid I think there might be an issue with the TileGrid.
    You have do add a datasource with dataFetchMode paged. Additionally you have to shrink down the tielgrid that it only displays 1 row and set the dataPageSize to an higher value than the first row.
    If you have 198 tiles in the datasource and the first row has 11 Items and you set the dataPageSize to e.g. 30. The TileGrid does request all tiles with 10 individual requests.


    Code:
    isc.TileGrid.create({
        "ID": "exampleTileGrid_70",
        "width": "100%",
        "height": "150",
        "hideUsingDisplayNone": false,
        "hoverWidth": 200,
        "tileWidth": 100,
        "tileHeight": 120,
        dataSource: isc.DataSource.create({
            "fields":
            [{
                    "name": "exampleTileGridGeneratedIndex",
                    "primaryKey": true,
                    "hidden": true,
                    "canView": false
                }, {
                    "name": "pictureTileGridField"
                }, {
                    "name": "nameTileGridField"
                }
            ],
            "dataFormat": "json",
            "dataURL": "ScTileGridDataSource?viewNumber=70&id=exampleTileGrid",
            "transformRequest": clwTransformRequest,
            "transformResponse": clwTransformResponse,
            "recordXPath": "\/resultData"
        }),
        "autoFetchData": true,
        "dataPageSize": 50,
        "clwDataSourceSelectedRecords":
        [],
        "fields":
        [{
                "name": "exampleTileGridGeneratedIndex",
                "primaryKey": true,
                "hidden": true,
                "canEdit": false,
                "canSort": false
            }, {
                "name": "pictureTileGridField"
            }, {
                "name": "nameTileGridField"
            }
        ],
        "showAllRecords": true,
        "clwGeneratedIndexName": "exampleTileGridGeneratedIndex",
        "selectionProperty": "isSelected",
    })
    The first response (which should be enough to show the initial row) looks like this:
    Code:
    {
     "totalRows":198,
     "viewNumber":3,
     "startRow":0,
     "resultData":
     [
      {
       "exampleTileGridGeneratedIndex":"1",
       "nameTileGridField":"about.png",
       "pictureTileGridField":"<img src=\"http:\/\/localhost\/images\/icons\/64\/about.png\"\/>"
      },
      {
       "exampleTileGridGeneratedIndex":"2",
       "nameTileGridField":"address_book2.png",
       "pictureTileGridField":"<img src=\"http:\/\/localhost\/images\/icons\/64\/address_book2.png\"\/>"
      },
      .........,
      {
       "exampleTileGridGeneratedIndex":"53",
       "nameTileGridField":"deck_chair.png",
       "pictureTileGridField":"<img src=\"http:\/\/localhost\/images\/icons\/64\/deck_chair.png\"\/>"
      }
     ],
     "endRow":51
    }
    Do you have any hints or mabye confirmation that there is an issue with the datasource?
    Best regards

    #2
    Please ignore this thread.
    showAllRecords was set to true, so the datasource does load all items...
    Sorry


    Comment

    Working...
    X