diff --git a/packages/base/components/ODataGridBase.tsx b/packages/base/components/ODataGridBase.tsx index e708d86..575a6ae 100644 --- a/packages/base/components/ODataGridBase.tsx +++ b/packages/base/components/ODataGridBase.tsx @@ -80,8 +80,14 @@ const ODataGridBase = Array.isArray(b) ? a.concat(b) : [...a, b], []); const query = new URLSearchParams(); - query.append("$select", Array.from(fields).join(",")); - query.append("$expand", ExpandToQuery(expands)); + if (fields.size > 0) { + query.append("$select", Array.from(fields).join(",")); + } + + if (expands.length > 0) { + query.append("$expand", ExpandToQuery(expands)); + } + query.append("$top", pageSize.toString()); query.append("$skip", (pageNumber * pageSize).toString()); diff --git a/packages/o-data-grid-pro/package.json b/packages/o-data-grid-pro/package.json index 94b5c7d..6aecf69 100644 --- a/packages/o-data-grid-pro/package.json +++ b/packages/o-data-grid-pro/package.json @@ -1,6 +1,6 @@ { "name": "o-data-grid-pro", - "version": "1.3.0", + "version": "1.3.1", "description": "A React Data Grid and Query Builder for OData APIs. Based on the Material-UI DataGridPro.", "main": "build/o-data-grid-pro-cjs.js", "module": "build/o-data-grid-pro-esm.js", diff --git a/packages/o-data-grid/package.json b/packages/o-data-grid/package.json index d2dd377..7e1e389 100644 --- a/packages/o-data-grid/package.json +++ b/packages/o-data-grid/package.json @@ -1,6 +1,6 @@ { "name": "o-data-grid", - "version": "1.3.0", + "version": "1.3.1", "description": "A React Data Grid and Query Builder for OData APIs. Based on the Material-UI DataGrid.", "main": "build/o-data-grid-cjs.js", "module": "build/o-data-grid-esm.js",