Add react-router-dom Link in ag-grid react











up vote
0
down vote

favorite












How can I replace a with of react-router-dom, in ag-grid. It is making the page reload instead of pretending to be a single page application.



I have tried with this but it doesn't work



cellRenderer:  (params)=> {
return <Link to={`/?info=${params.data.Id}`}>"+{params.value}+"</Link>,


Is there a possibility that we can use Link instead of



cellRenderer:  function(params){
return "<a href='/?info=" + params.data.Id+ "'>"+params.value+"</a>";},


when using Link it is throwing the Error:




Error: ag-Grid: cannot get grid to draw rows when it is in the middle
of drawing rows. Your code probably called a grid API method while the
grid was in the render stage. To overcome this, put the API call into
a timeout, eg instead of api.refreshView(), call
setTimeout(function(){api.refreshView(),0}). To see what part of your
code that caused the refresh check this stacktrace.




The error in stacktrace points to the code below, But with element it works fine:




===> GetAPI(){ var url = xxxxxxxxxxx; axios.get(url).then(response => { if (response.status == 200) { this.setState({ patients:
response.data, loading: false }); } }) .catch(e => console.log('Error
While Fetching Fee List: at Listing/index.js > Error: ', e.message,'n
for user : ',this.props.auth.user.email)) }.











share|improve this question
























  • when using Link is it throwing any error.
    – AkshayM
    Oct 28 at 11:55










  • and when you anchor tag it will reload the page which is a default and expected behavior
    – AkshayM
    Oct 28 at 11:55










  • when using Link it is throwing the Error: Error: ag-Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, eg instead of api.refreshView(), call setTimeout(function(){api.refreshView(),0}). To see what part of your code that caused the refresh check this stacktrace.
    – abdul
    Oct 28 at 15:55












  • I am not able to reproduce the error. Can you make stackblitz of some part of your code, so that I can fix it for you?
    – AkshayM
    Oct 28 at 19:21










  • I can't share my piece of code, but the error in stacktrace points to the code below, But with <a> element it works fine ===> GetAPI(){ var url = xxxxxxxxxxx; axios.get(url).then(response => { if (response.status == 200) { this.setState({ patients: response.data, loading: false }); } }) .catch(e => console.log('Error While Fetching Fee List: at Listing/index.js > Error: ', e.message,'n for user : ',this.props.auth.user.email)) }.
    – abdul
    Oct 29 at 13:52

















up vote
0
down vote

favorite












How can I replace a with of react-router-dom, in ag-grid. It is making the page reload instead of pretending to be a single page application.



I have tried with this but it doesn't work



cellRenderer:  (params)=> {
return <Link to={`/?info=${params.data.Id}`}>"+{params.value}+"</Link>,


Is there a possibility that we can use Link instead of



cellRenderer:  function(params){
return "<a href='/?info=" + params.data.Id+ "'>"+params.value+"</a>";},


when using Link it is throwing the Error:




Error: ag-Grid: cannot get grid to draw rows when it is in the middle
of drawing rows. Your code probably called a grid API method while the
grid was in the render stage. To overcome this, put the API call into
a timeout, eg instead of api.refreshView(), call
setTimeout(function(){api.refreshView(),0}). To see what part of your
code that caused the refresh check this stacktrace.




The error in stacktrace points to the code below, But with element it works fine:




===> GetAPI(){ var url = xxxxxxxxxxx; axios.get(url).then(response => { if (response.status == 200) { this.setState({ patients:
response.data, loading: false }); } }) .catch(e => console.log('Error
While Fetching Fee List: at Listing/index.js > Error: ', e.message,'n
for user : ',this.props.auth.user.email)) }.











share|improve this question
























  • when using Link is it throwing any error.
    – AkshayM
    Oct 28 at 11:55










  • and when you anchor tag it will reload the page which is a default and expected behavior
    – AkshayM
    Oct 28 at 11:55










  • when using Link it is throwing the Error: Error: ag-Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, eg instead of api.refreshView(), call setTimeout(function(){api.refreshView(),0}). To see what part of your code that caused the refresh check this stacktrace.
    – abdul
    Oct 28 at 15:55












  • I am not able to reproduce the error. Can you make stackblitz of some part of your code, so that I can fix it for you?
    – AkshayM
    Oct 28 at 19:21










  • I can't share my piece of code, but the error in stacktrace points to the code below, But with <a> element it works fine ===> GetAPI(){ var url = xxxxxxxxxxx; axios.get(url).then(response => { if (response.status == 200) { this.setState({ patients: response.data, loading: false }); } }) .catch(e => console.log('Error While Fetching Fee List: at Listing/index.js > Error: ', e.message,'n for user : ',this.props.auth.user.email)) }.
    – abdul
    Oct 29 at 13:52















up vote
0
down vote

favorite









up vote
0
down vote

favorite











How can I replace a with of react-router-dom, in ag-grid. It is making the page reload instead of pretending to be a single page application.



I have tried with this but it doesn't work



cellRenderer:  (params)=> {
return <Link to={`/?info=${params.data.Id}`}>"+{params.value}+"</Link>,


Is there a possibility that we can use Link instead of



cellRenderer:  function(params){
return "<a href='/?info=" + params.data.Id+ "'>"+params.value+"</a>";},


when using Link it is throwing the Error:




Error: ag-Grid: cannot get grid to draw rows when it is in the middle
of drawing rows. Your code probably called a grid API method while the
grid was in the render stage. To overcome this, put the API call into
a timeout, eg instead of api.refreshView(), call
setTimeout(function(){api.refreshView(),0}). To see what part of your
code that caused the refresh check this stacktrace.




The error in stacktrace points to the code below, But with element it works fine:




===> GetAPI(){ var url = xxxxxxxxxxx; axios.get(url).then(response => { if (response.status == 200) { this.setState({ patients:
response.data, loading: false }); } }) .catch(e => console.log('Error
While Fetching Fee List: at Listing/index.js > Error: ', e.message,'n
for user : ',this.props.auth.user.email)) }.











share|improve this question















How can I replace a with of react-router-dom, in ag-grid. It is making the page reload instead of pretending to be a single page application.



I have tried with this but it doesn't work



cellRenderer:  (params)=> {
return <Link to={`/?info=${params.data.Id}`}>"+{params.value}+"</Link>,


Is there a possibility that we can use Link instead of



cellRenderer:  function(params){
return "<a href='/?info=" + params.data.Id+ "'>"+params.value+"</a>";},


when using Link it is throwing the Error:




Error: ag-Grid: cannot get grid to draw rows when it is in the middle
of drawing rows. Your code probably called a grid API method while the
grid was in the render stage. To overcome this, put the API call into
a timeout, eg instead of api.refreshView(), call
setTimeout(function(){api.refreshView(),0}). To see what part of your
code that caused the refresh check this stacktrace.




The error in stacktrace points to the code below, But with element it works fine:




===> GetAPI(){ var url = xxxxxxxxxxx; axios.get(url).then(response => { if (response.status == 200) { this.setState({ patients:
response.data, loading: false }); } }) .catch(e => console.log('Error
While Fetching Fee List: at Listing/index.js > Error: ', e.message,'n
for user : ',this.props.auth.user.email)) }.








reactjs react-router-dom ag-grid-react






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 19 at 8:18









c-chavez

2,09321629




2,09321629










asked Oct 28 at 11:47









abdul

5019




5019












  • when using Link is it throwing any error.
    – AkshayM
    Oct 28 at 11:55










  • and when you anchor tag it will reload the page which is a default and expected behavior
    – AkshayM
    Oct 28 at 11:55










  • when using Link it is throwing the Error: Error: ag-Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, eg instead of api.refreshView(), call setTimeout(function(){api.refreshView(),0}). To see what part of your code that caused the refresh check this stacktrace.
    – abdul
    Oct 28 at 15:55












  • I am not able to reproduce the error. Can you make stackblitz of some part of your code, so that I can fix it for you?
    – AkshayM
    Oct 28 at 19:21










  • I can't share my piece of code, but the error in stacktrace points to the code below, But with <a> element it works fine ===> GetAPI(){ var url = xxxxxxxxxxx; axios.get(url).then(response => { if (response.status == 200) { this.setState({ patients: response.data, loading: false }); } }) .catch(e => console.log('Error While Fetching Fee List: at Listing/index.js > Error: ', e.message,'n for user : ',this.props.auth.user.email)) }.
    – abdul
    Oct 29 at 13:52




















  • when using Link is it throwing any error.
    – AkshayM
    Oct 28 at 11:55










  • and when you anchor tag it will reload the page which is a default and expected behavior
    – AkshayM
    Oct 28 at 11:55










  • when using Link it is throwing the Error: Error: ag-Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, eg instead of api.refreshView(), call setTimeout(function(){api.refreshView(),0}). To see what part of your code that caused the refresh check this stacktrace.
    – abdul
    Oct 28 at 15:55












  • I am not able to reproduce the error. Can you make stackblitz of some part of your code, so that I can fix it for you?
    – AkshayM
    Oct 28 at 19:21










  • I can't share my piece of code, but the error in stacktrace points to the code below, But with <a> element it works fine ===> GetAPI(){ var url = xxxxxxxxxxx; axios.get(url).then(response => { if (response.status == 200) { this.setState({ patients: response.data, loading: false }); } }) .catch(e => console.log('Error While Fetching Fee List: at Listing/index.js > Error: ', e.message,'n for user : ',this.props.auth.user.email)) }.
    – abdul
    Oct 29 at 13:52


















when using Link is it throwing any error.
– AkshayM
Oct 28 at 11:55




when using Link is it throwing any error.
– AkshayM
Oct 28 at 11:55












and when you anchor tag it will reload the page which is a default and expected behavior
– AkshayM
Oct 28 at 11:55




and when you anchor tag it will reload the page which is a default and expected behavior
– AkshayM
Oct 28 at 11:55












when using Link it is throwing the Error: Error: ag-Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, eg instead of api.refreshView(), call setTimeout(function(){api.refreshView(),0}). To see what part of your code that caused the refresh check this stacktrace.
– abdul
Oct 28 at 15:55






when using Link it is throwing the Error: Error: ag-Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, eg instead of api.refreshView(), call setTimeout(function(){api.refreshView(),0}). To see what part of your code that caused the refresh check this stacktrace.
– abdul
Oct 28 at 15:55














I am not able to reproduce the error. Can you make stackblitz of some part of your code, so that I can fix it for you?
– AkshayM
Oct 28 at 19:21




I am not able to reproduce the error. Can you make stackblitz of some part of your code, so that I can fix it for you?
– AkshayM
Oct 28 at 19:21












I can't share my piece of code, but the error in stacktrace points to the code below, But with <a> element it works fine ===> GetAPI(){ var url = xxxxxxxxxxx; axios.get(url).then(response => { if (response.status == 200) { this.setState({ patients: response.data, loading: false }); } }) .catch(e => console.log('Error While Fetching Fee List: at Listing/index.js > Error: ', e.message,'n for user : ',this.props.auth.user.email)) }.
– abdul
Oct 29 at 13:52






I can't share my piece of code, but the error in stacktrace points to the code below, But with <a> element it works fine ===> GetAPI(){ var url = xxxxxxxxxxx; axios.get(url).then(response => { if (response.status == 200) { this.setState({ patients: response.data, loading: false }); } }) .catch(e => console.log('Error While Fetching Fee List: at Listing/index.js > Error: ', e.message,'n for user : ',this.props.auth.user.email)) }.
– abdul
Oct 29 at 13:52



















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53031160%2fadd-react-router-dom-link-in-ag-grid-react%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53031160%2fadd-react-router-dom-link-in-ag-grid-react%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Costa Masnaga

Fotorealismo

Sidney Franklin