Skip to content

Conversation

@YOUNGHO8762
Copy link
Contributor

@YOUNGHO8762 YOUNGHO8762 commented Sep 23, 2025

Description

This PR updates the GridStackProvider API to accept widget objects directly instead of callback functions, simplifying the interface for adding widgets and subgrids.

Changes

  • Modified addWidget implementation to accept widget object directly and use provided ID
  • Modified addSubGrid implementation to accept subgrid object with children array
  • Removed internal ID generation logic and callback-based widget creation

Benefits

  • Simplified API usage - no need for callback functions
  • Better control over widget IDs for consumers
  • More predictable widget creation process
  • Cleaner type definitions and implementation

Checklist

  • Created tests which fail without the change (if possible)
  • All tests passing (yarn test)
  • Extended the README / documentation, if necessary

@adumesny adumesny merged commit 41e90b4 into gridstack:master Sep 23, 2025
@adumesny
Copy link
Member

I like that it uses the GS methods directly with little extra code. If you look at the Angualr wrapper, you can still access all API directly from GridComponent.grid and you get callback to create the angular wrappers needed, btu GS API can be used directly.... no need to dup the API and doc is the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants