Giter Club home page Giter Club logo

spfx's People

Contributors

ajixumuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

spfx's Issues

iframe-dialog-example, how to pass url as an argument?..

Greetings Alex!

Thank You for examples, there is not much documentation about react controls for SharePoint SPFx.

Not an issue, but question..

How to pass url argument and call open function for different urls?..

export default class IframeDialog extends React.Component<IIframeDialogProps, IIframeDialogState> {
  public constructor(props: IIframeDialogProps) {
    super(props);

    this.state = {
      isDlgOpen: false
    };
  }
  public render(): React.ReactElement<IIframeDialogProps> {
    return (
      <div className={styles.iframeDialog}>
        <div className={styles.container}>
          <div className={styles.row}>
            <div className={styles.column}>
              <span className={styles.title}>Welcome to SharePoint!</span>
              <p className={styles.subTitle}>Customize SharePoint experiences using Web Parts.</p>
              <p className={styles.description}>{escape(this.props.description)}</p>
              <PrimaryButton text={'Open Dialog'} onClick={this._onClick.bind(this)} />
              <IFrameDialog
                url={'/temp/workbench.html'}
                iframeOnLoad={this._onDlgLoaded.bind(this)}
                hidden={!this.state.isDlgOpen}
                onDismiss={this._onDlgDismiss.bind(this)}
                modalProps={{
                  isBlocking: true
                }}
                dialogContentProps={{
                  type: DialogType.close,
                  showCloseButton: true
                }}
                width={'570px'}
                height={'315px'} />
            </div>
          </div>
        </div>
      </div>
    );
  }

  private _onClick(): void {
    this.setState({
      isDlgOpen: true, 
      url: "http://google.com"
    });
  }

  private _onDlgDismiss(): void {
    this.setState({
      isDlgOpen: false
    });
  }

  private _onDlgLoaded(): void {
    console.log('dlg is loaeded');
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.