Results 1 to 2 of 2

Thread: Strange behaviour of BadgeText

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member
    Join Date
    Oct 2011
    Location
    Trieste, italy
    Posts
    33
    Vote Rating
    0
      0  

    Default Strange behaviour of BadgeText

    Hi,
    I created an example to explain a strange behaviour I have on BadgeText.
    In MyExample component I have a button with an handler on click that will increment a counter.
    On the tabpanel and on the button I have two similar BadgeTexts with the same binding to the counter.
    When I click on the button I expect the counter to increment and the BadgeTexts to update with the new value.
    What I got instead was that the counter was incremented (verified logging its state) and only the BadgeText on the button got its value updated.
    I tried to bind a panel title to the same counter and it got updated, it's just the BadgeText that will stay unmodified.
    Did I miss something or it is a bug?
    Code:
    import React, { Component } from 'react';
    import { launch } from '@extjs/reactor';
    import { Container, TabPanel, Button, Panel } from '@extjs/ext-react';
    
    export default class MyExample extends Component {
        
        constructor(props) {
            super(props)
            this.state={
                counter:1
            }
        }
        
        handle=(btn) => {
            var counter=this.state.counter
            counter++
            this.setState({
                counter: counter
            })
        }
        render() {
            console.log(this.state.counter)
            return (
                <Container>
                    <Button text='button' handler={this.handle.bind(this)} badgeText={this.state.counter}/>
                    <TabPanel
                        shadow
                        flex={1}
                        defaults={{
                            tab: {
                                minWidth: 130
                            }
                        }}
                    >
                    <Panel title={'panel title'+this.state.counter} badgeText={this.state.counter}/>
                    </TabPanel>
                </Container>
            )
        }
        
    }
    
    launch(<MyExample />);

  2. #2
    Ext JS Premium Member
    Join Date
    Oct 2011
    Location
    Trieste, italy
    Posts
    33
    Vote Rating
    0
      0  

    Default

    Any updates please?

Similar Threads

  1. Strange behaviour of BadgeText
    By emaze in forum Bugs
    Replies: 0
    Last Post: 24 Nov 2017, 3:41 AM
  2. [CLOSED] Strange IE behaviour (Ext GWT 3 - beta 4)
    By EthiC in forum Sencha GXT Bugs
    Replies: 12
    Last Post: 22 May 2012, 2:19 PM
  3. Ext.Img strange behaviour
    By Biohazard in forum Ext: Discussion
    Replies: 4
    Last Post: 4 Mar 2012, 7:26 AM
  4. Strange behaviour with CSS
    By tarikonen in forum Ext.nd for Notes/Domino
    Replies: 2
    Last Post: 9 Feb 2008, 12:39 AM
  5. Ext.Ajax strange behaviour
    By karantir in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 19 Jul 2007, 7:42 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
  •