Results 1 to 8 of 8

Thread: [6.5.1] Changing Grid Title when titleBar is set fails

    You found a bug! We've classified it as EXTJS-26136 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Dec 2013
    Posts
    6
    Vote Rating
    1
      0  

    Default [6.5.1] Changing Grid Title when titleBar is set fails

    I'm running into a problem where a Grid that has the titleBar prop set fails to update when it's title prop is changed. constructor.updateTitleBar throws 'titleBar.getTitle is not a function' in this code block:

    Code:
    updateTitleBar:function(titleBar) {
      if (titleBar && !titleBar.getTitle()) {
        titleBar.setTitle(this.getTitle());
      }
    }
    A stripped down version of the render is below. If titleBar is not set on the grid, using the Previous/Next buttons above the grid works and the title changes (as well as the store and columns). If titleBar is set, the grid renders the first time but changing the projectName causes the titleBar.getTitle error. The individual buttons and the buttons embedded in the titleBar are using the same handlers. The handlers don't touch the grid props, they update a separate state and the grid and titlebar props are calculated from that in the render(). I've tried the following combinations:


    1. grid.title set, grid.titleBar not set [PASS]
    2. grid.title set, grid.titleBar set w/o titleBar.title [FAIL]
    3. grid.title set, grid.titleBar set w/ titleBar.title [FAIL]
    4. grid.title not set, grid.titleBar set w/ titleBar.title [FAIL]


    I did notice the titleBar prop is not listed in the ExtReact documentation but it is used in the BigData grid example.

    Code:
    const titleBarProps:any = {
        title  : projectName,
        shadow : false,
        items  : [{
            align   : 'left',
            xtype   : 'button',
            iconCls : 'x-fa fa-chevron-left',
            handler : this.props.onPreviousProject    
        },{
            align   : 'right',
            xtype   : 'button',
            iconCls : 'x-fa fa-chevron-left',
            handler : this.props.onNextProject    
        }]
    }
    
    
    return (<Container>
        <Button text="Previous" handler={this.props.onPreviousProject} />
        <Button text="Next" handler={this.props.onNextProject} />
        <Grid
            title={projectName}
            store={project.store}
            columns={(columns as any)}
            titleBar={titleBarProps}
            {...this.gridProps}
        />                                    
    </Container>)

  2. #2
    Sencha User Mark.Brocato's Avatar
    Join Date
    Mar 2015
    Location
    Maryland
    Posts
    481
    Vote Rating
    53
      0  

    Default

    I suggest docking your own TitleBar to the top of the grid:

    https://fiddle.sencha.com/?extreact#...or&fiddle/24uk

  3. #3
    Sencha User Mark.Brocato's Avatar
    Join Date
    Mar 2015
    Location
    Maryland
    Posts
    481
    Vote Rating
    53
      0  

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

  4. #4
    Sencha User
    Join Date
    Dec 2013
    Posts
    6
    Vote Rating
    1
      0  

    Default

    Quote Originally Posted by Mark.Brocato View Post
    I suggest docking your own TitleBar to the top of the grid:

    https://fiddle.sencha.com/?extreact#...or&fiddle/24uk
    That's what I ended up doing, that works perfectly.

  5. #5
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    2,378
    Vote Rating
    720
      -1  

    Default

    Quote Originally Posted by Mark.Brocato View Post
    I suggest docking your own TitleBar to the top of the grid:

    https://fiddle.sencha.com/?extreact#...or&fiddle/24uk

    Why am I seeing this error in the fiddle's console?

    Uncaught TypeError: Cannot read property 'tab' of null
    at ai.enactReact (/classic/app.js?_dc=20170711084405:3)
    at /classic/framework.js?_dc=20170711084405:1
    at ai.fire (/classic/framework.js?_dc=20170711084405:1)
    at ai.doFireEvent (/classic/framework.js?_dc=20170711084405:1)
    at ai.f.doFireEvent (/classic/framework.js?_dc=20170711084405:1)
    at ai.fireEventArgs (/classic/framework.js?_dc=20170711084405:1)
    at ai.fireEvent (/classic/framework.js?_dc=20170711084405:1)
    at ai.onProxyLoad (/classic/framework.js?_dc=20170711084405:1)
    at ai.triggerCallbacks (/classic/framework.js?_dc=20170711084405:1)
    at ai.setCompleted (/classic/framework.js?_dc=20170711084405:1)
    I'm an Ext JS contractor. Hire me in the Chicago area!

  6. #6
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    2,378
    Vote Rating
    720
      -1  

    Default

    Quote Originally Posted by Mark.Brocato View Post
    I suggest docking your own TitleBar to the top of the grid:

    https://fiddle.sencha.com/?extreact#...or&fiddle/24uk
    I wish there was some sort of indicator in the list of bugs showing which bug includes a fiddle.

    The fiddles that you provide are a very useful learning tool.

  7. #7
    Sencha User
    Join Date
    Dec 2013
    Posts
    6
    Vote Rating
    1
      0  

    Default

    Quote Originally Posted by LesJ View Post
    Why am I seeing this error in the fiddle's console?

    Uncaught TypeError: Cannot read property 'tab' of null
    For what it's worth I get the same with the fiddle (Chrome 60.0.3112.90/Linux 64bit)

  8. #8
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    2,378
    Vote Rating
    720
      -1  

    Default

    Quote Originally Posted by thesandbender View Post
    For what it's worth I get the same with the fiddle (Chrome 60.0.3112.90/Linux 64bit)
    I see the same error on a Mac.

    Screen Shot 2017-08-11 at 4.27.20 PM.jpg

Similar Threads

  1. Changing grid panels title dynamically
    By PaulBuys in forum Sencha Architect 3.x: Q&A
    Replies: 1
    Last Post: 26 Jun 2015, 7:08 AM
  2. Replies: 3
    Last Post: 11 Sep 2014, 6:03 PM
  3. Can't style titlebar title
    By munder in forum Sencha Touch 2.x: Q&A
    Replies: 3
    Last Post: 24 Sep 2012, 1:31 PM
  4. Universal Ext.TitleBar title not changing
    By jcming in forum Sencha Touch 2.x: Q&A
    Replies: 6
    Last Post: 11 Jul 2012, 3:20 AM
  5. Changing grid title according to ordering
    By rshimoda in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 28 Aug 2008, 5:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •