jQWidgets Forums

jQuery UI Widgets Forums React Window losing the closing X

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  assembler 7 years, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Window losing the closing X #98371

    assembler
    Participant

    Hi there:

    I have the following code:

     winRefBuilder = (win) => {
         this.window = win;
      }
    
      componentDidMount() {
         this.window.on('close', () => {
            this.props.closing();
         });
      }
    
      componentDidUpdate (prevProps, prevState) {
         if (prevProps.open !== this.props.open && this.props.open) {
            this.window.showCloseButton(true);     // <-----
            this.window.open();
         }
    
         if (prevProps.editing !== this.props.editing) {
             /* ... editing is an object that contains the values to show in the body of the window, lets say:
                this.input1.val(this.props.editing.value1);
                this.input2.val(this.props.editing.value2);
             */
         }
      }
    
       render(){
        return (<JqxWindow
          ref={this.winRefBuilder} isModal resizable={false} autoOpen={false} width={800} height={600}>
          <div>{'This is my title'}</div>
          <div>
             // ... this is the body with two JqxInput        
          </div>
        </JqxWindow>);
    

    The closing prop is a function from the parent component, which is:

    closing = () => {
       this.setState({open: false});
    }

    If editing prop does not exist everything works fine, but if editing prop exists then the tinny X from the right upper corner disappears for good, no matter the contents in editing. Note that I’m trying to force the X to show, but it does not. What am I missing here?

    Window losing the closing X #98426

    Hristo
    Participant

    Hello assembler,

    I would suggest you try to create the jqxInput in the initContent callback it is a reason for many issues.
    About this you could use the approach in this demo below for the jqxTree:
    https://www.jqwidgets.com/react/react-dockinglayout/react-dockinglayout-defaultfunctionality.htm
    Please, write me if there is some error message.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Window losing the closing X #98431

    assembler
    Participant

    THank you Mr. Hristo

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.