Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bbar : { type : 'pagingtoolbar' } typing error #8672

Closed
rubiconsid opened this issue Feb 23, 2024 · 4 comments
Closed

bbar : { type : 'pagingtoolbar' } typing error #8672

rubiconsid opened this issue Feb 23, 2024 · 4 comments
Assignees
Labels
docs Improvements or additions to documentation resolved Fixed but not yet released (available in the nightly builds) typescript
Milestone

Comments

@rubiconsid
Copy link

rubiconsid commented Feb 23, 2024

When working with Grid Paged fw demos, noticed that bbar : { type : 'pagingtoolbar' } is not working in typescript

const gridConfig : Partial<GridConfig> = {
......
    bbar : { 
        type : 'pagingtoolbar'
    }
 

Have discussed with Saki, and suggested to report to Sergey to have a look in typing bug for below:

image

image

In fw demos now, it is using strips instead as workaround for issue above .

      strips : {
            bottom : {
                dock : 'bottom',
                type : 'pagingtoolbar'
            }
        }

image

@SergeyMaltsev
Copy link
Contributor

@rubiconsid from docs and type declaration it shows that you may use Partial<ContainerItemConfig> or string as array

image

https://bryntum.com/products/grid/docs/api/Core/widget/Panel#config-bbar

Did you try the below?

const gridConfig : Partial<GridConfig> = {
....
    bbar : [ 'pagingtoolbar' ]

or

const gridConfig : Partial<GridConfig> = {
......
    bbar : [{ 
        type : 'pagingtoolbar'
    }]

Please change docs for tbar and bbar if they don't match the API code.

@rubiconsid
Copy link
Author

rubiconsid commented Feb 24, 2024

@SergeyMaltsev Yes, have tried below which did not work before asking you for some advice.

    bbar : [
            'pagingtoolbar'
        ],

it's not right..
Screenshot 2024-02-24 at 11 02 11
or

        bbar : [
            {
                type : 'pagingtoolbar'
            }
        ],

this not able to recieve data
image

....
So would like to know how to change docs correctly for the config to work below : ?

        bbar : 
            {
                type : 'pagingtoolbar'
            }
        

Can I do this?
image

@SergeyMaltsev
Copy link
Contributor

SergeyMaltsev commented Feb 26, 2024

@rubiconsid please fix docs to match what is expected by API.
The fix should be for bbar, tbar properties if they don't match what is expected by API.
Contact our API devs for clarifying.

Also you can not use TypeScript in codebase.

This is PagingToolbar class declaration:

 * @extends Core/widget/Toolbar
 * @classtype pagingtoolbar
 * @widget
 */
export default class PagingToolbar extends Toolbar {
    static $name = 'PagingToolbar';
    static type = 'pagingtoolbar';

@rubiconsid
Copy link
Author

Prediscussed with Sergey for a fix as below in Paged demo PR, which will need Johan's doublecheck:
In Panel.js

/**
             * A Config object representing the configuration of a {@link Core.widget.PagingToolbar}, <---
             * or array of config objects representing the child items of a Toolbar.
             *
             * This creates a toolbar docked to the top of the panel immediately below the header.
             * @config {Array<ContainerItemConfig|String>|ToolbarConfig|PagingToolbarConfig} <---
             * @category Content
             */
            tbar : null,

            /**
             * Get toolbar {@link Core.widget.Toolbar} docked to the bottom of the panel
             * @member {Core.widget.Toolbar} bbar
             * @readonly
             * @category Content
             */
            /**
             * A Config object representing the configuration of a {@link Core.widget.PagingToolbar},  <----
             * or array of config objects representing the child items of a Toolbar.
             *
             * This creates a toolbar docked to the bottom of the panel immediately above the footer.
             * @config {Array<ContainerItemConfig|String>|ToolbarConfig|PagingToolbarConfig} <----
             * @category Content
             */
            bbar : null, 

@rubiconsid rubiconsid added ready for review Issue is fixed, the pull request is being reviewed docs Improvements or additions to documentation and removed in progress labels Mar 8, 2024
@SergeyMaltsev SergeyMaltsev added resolved Fixed but not yet released (available in the nightly builds) and removed ready for review Issue is fixed, the pull request is being reviewed labels Mar 14, 2024
@SergeyMaltsev SergeyMaltsev added this to the 5.6.9 milestone Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation resolved Fixed but not yet released (available in the nightly builds) typescript
Projects
None yet
Development

No branches or pull requests

2 participants