Click here to Skip to main content
15,886,362 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Trying to download Zip files that's returned from Api React Pin
simpledeveloper20-Oct-19 14:38
simpledeveloper20-Oct-19 14:38 
GeneralRe: Trying to download Zip files that's returned from Api React Pin
simpledeveloper21-Oct-19 8:08
simpledeveloper21-Oct-19 8:08 
GeneralRe: Trying to download Zip files that's returned from Api React Pin
simpledeveloper21-Oct-19 10:09
simpledeveloper21-Oct-19 10:09 
AnswerRe: Trying to download Zip files that's returned from Api React Pin
simpledeveloper21-Oct-19 8:10
simpledeveloper21-Oct-19 8:10 
QuestionAppending an Array of strings is giving me objects instead of strings separated with commas, my code and results are as below Pin
simpledeveloper14-Oct-19 6:32
simpledeveloper14-Oct-19 6:32 
AnswerRe: Appending an Array of strings is giving me objects instead of strings separated with commas, my code and results are as below Pin
Richard Deeming14-Oct-19 7:32
mveRichard Deeming14-Oct-19 7:32 
GeneralRe: Appending an Array of strings is giving me objects instead of strings separated with commas, my code and results are as below Pin
simpledeveloper14-Oct-19 8:18
simpledeveloper14-Oct-19 8:18 
QuestionCalling Api post method on button click in React Pin
simpledeveloper10-Oct-19 12:11
simpledeveloper10-Oct-19 12:11 
I have an event like below:

handleDownload(e) {
        e.preventDefault();
        alert('Hi');
        let communityName = this.state['selectedCommunity'];
        let files = this.state[files];

        fetch(clientConfiguration['filesApi.local'], {
            method: 'POST',
            headers: new Headers(),
            body: JSON.stringify({ communityName: communityName, body: files })
        }).then((res) => res.json())
            .then((data) => console.log(data))
            .catch((err) => console.log(err))
    };

I have a button as below:

        renderDownloadButton() {
        if (this.state.files && this.state.files.filter(i => i.checked).length) {
            return (
                <button id="download" styles="display: none;" onClick={this.handleDownload} >
                    Download
        </button>
            );
        }
    };


It fires but it is giving following error, any help please - thank you. At

let communityName = this.state['selectedCommunity'];


its giving me the error;

Can not read property state undefined


Any help please?
AnswerRe: Calling Api post method on button click in React Pin
jkirkerx10-Oct-19 13:40
professionaljkirkerx10-Oct-19 13:40 
GeneralRe: Calling Api post method on button click in React Pin
simpledeveloper10-Oct-19 15:18
simpledeveloper10-Oct-19 15:18 
QuestionI am trying to read from a Web api call and assign it to a state in React component Pin
simpledeveloper9-Oct-19 11:31
simpledeveloper9-Oct-19 11:31 
AnswerRe: I am trying to read from a Web api call and assign it to a state in React component Pin
jkirkerx10-Oct-19 13:31
professionaljkirkerx10-Oct-19 13:31 
Questionprogramming a dropdown menu to display specific points in the charts Pin
Gibby905-Oct-19 6:41
Gibby905-Oct-19 6:41 
QuestionSearch Engine without DB using JS Pin
javadev20904-Oct-19 9:06
javadev20904-Oct-19 9:06 
AnswerRe: Search Engine without DB using JS Pin
jkirkerx8-Oct-19 13:45
professionaljkirkerx8-Oct-19 13:45 
GeneralRe: Search Engine without DB using JS Pin
javadev20908-Oct-19 19:44
javadev20908-Oct-19 19:44 
GeneralRe: Search Engine without DB using JS Pin
jkirkerx9-Oct-19 7:35
professionaljkirkerx9-Oct-19 7:35 
Questionjquery validation in drop down Pin
Shraddha_Patel3-Oct-19 18:50
Shraddha_Patel3-Oct-19 18:50 
AnswerRe: jquery validation in drop down Pin
ZurdoDev4-Oct-19 1:04
professionalZurdoDev4-Oct-19 1:04 
GeneralRe: jquery validation in drop down Pin
Member 149853463-Mar-21 17:02
Member 149853463-Mar-21 17:02 
AnswerRe: jquery validation in drop down Pin
jkirkerx8-Oct-19 13:47
professionaljkirkerx8-Oct-19 13:47 
QuestionHow to display a Javascript alert and display a iframe using a javascript dynamic drop-down list Pin
codeguy13-Oct-19 19:14
codeguy13-Oct-19 19:14 
AnswerRe: How to display a Javascript alert and display a iframe using a javascript dynamic drop-down list Pin
ZurdoDev4-Oct-19 1:07
professionalZurdoDev4-Oct-19 1:07 
GeneralRe: How to display a Javascript alert and display a iframe using a javascript dynamic drop-down list Pin
codeguy14-Oct-19 19:42
codeguy14-Oct-19 19:42 
AnswerRe: How to display a Javascript alert and display a iframe using a javascript dynamic drop-down list Pin
ZurdoDev6-Oct-19 8:54
professionalZurdoDev6-Oct-19 8:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.