You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Grid.js primarily supports server-side pagination using GET requests, where parameters like prev, page, limit are appended to the URL. However, there are scenarios where using POST requests would be advantageous:
Large Filter Sets: GET requests have URL length limitations, which can be problematic when sending many filter parameters. POST requests allow for larger payloads.
Security: POST requests are generally considered more secure than GET requests for sending sensitive data.
API Design: Some APIs are designed to accept filter parameters in the request body rather than the URL.
Proposed Enhancement:
I propose adding an option to the pagination.server configuration to allow using POST requests for pagination. This would involve:
method: 'POST': Allow setting the HTTP method to 'POST'.
body Function: Allow defining a body function that would be called for each pagination request. This function would receive the config object (containing page, pageSize, etc.) and could include additional fields for filtering.
Consistent Body Format: Ensure that the body function in the main server configuration (for initial data loading) and the pagination.server configuration (for pagination requests) can have the same structure for consistency.
This enhancement would make Grid.js more versatile and adaptable to different backend API designs. It would address the limitations of GET requests and provide a more secure way to send filter parameters.
Additional Considerations:
Error Handling: Enhance the error handling mechanisms to provide clear feedback to users if the POST request fails.
Documentation: Update the documentation to clearly explain how to use this new feature and its benefits.
I hope this feature request is helpful! Let me know if you have any other questions or would like to refine it further.
The text was updated successfully, but these errors were encountered:
Description:
Currently, Grid.js primarily supports server-side pagination using GET requests, where parameters like
prev
,page
,limit
are appended to the URL. However, there are scenarios where using POST requests would be advantageous:Proposed Enhancement:
I propose adding an option to the
pagination.server
configuration to allow using POST requests for pagination. This would involve:method: 'POST'
: Allow setting the HTTP method to'POST'
.body
Function: Allow defining abody
function that would be called for each pagination request. This function would receive theconfig
object (containing page, pageSize, etc.) and could include additional fields for filtering.body
function in the mainserver
configuration (for initial data loading) and thepagination.server
configuration (for pagination requests) can have the same structure for consistency.Example Code:
Justification:
This enhancement would make Grid.js more versatile and adaptable to different backend API designs. It would address the limitations of GET requests and provide a more secure way to send filter parameters.
Additional Considerations:
I hope this feature request is helpful! Let me know if you have any other questions or would like to refine it further.
The text was updated successfully, but these errors were encountered: