React GridComponent Not Refreshing on render

Hi

I have a functional component containing a gridcomponent with the datasource as an array of objects passed in as a prop.
within the component i also have a simple datepickercomponent which calls a funciton in the parent to add the date to the array prop.

On adding to the data array the prop gets updated and can be shown in the console but the griditself does not refresh.

{console.log("DATA", props.data)}
 <GridComponent
        dataSource={props.data}
        allowPaging={false}
        allowSorting={false}
      >
        <ColumnsDirective>
          <ColumnDirective            
            headerText="Date"
            field="Date"
            type="date"
            format="dd/MM/yyyy"
          />
        ColumnsDirective>
      GridComponent>

3 Replies

RS Rajapandiyan Settu Syncfusion Team March 26, 2020 10:17 AM UTC

Hi David, 
 
Greetings from syncfusion support. 
 
Query :  within the component i also have a simple datepickercomponent which calls a funciton in the parent to add the date to the array prop.On adding to the data array the prop gets updated and can be shown in the console but the griditself does not refresh. 
 
Before proceeding with your query we need more information to clearly understand your requirement. So please share the below details. 
 
  1. Can you please explain your requirement in detail.
  2. When you call the function from parent component. ( During editing or any other action on datepickercomponent )
  3. Are you changed the dataSource of the grid and need to affect that in the grid UI?
  4. Share the full code of parent component and child component.
  5. If possible share the problem reproduced sample or make it in the given sample.
 
Please get back to us with above details which will be helpful for us to validate further and provide solution as soon as possible. 
 
Regards, 
Rajapandiyan S.     



SU Suresh January 14, 2021 09:34 PM UTC

I have the same problem. Did this get resolved? If so...how?


RS Rajapandiyan Settu Syncfusion Team January 15, 2021 08:11 AM UTC

Hi Suresh, 

Thanks for contacting Syncfusion support. 

Before proceeding with your query we need more information to clearly understand your requirement. So please share the below details. 

  1. Can you please explain your requirement in detail.
  2. Share the full code of Grid you have used.
  3. Share the video demo of reported problem.
  4. Share the package.json file.
  5. If possible share the simple reproducible sample with us.

Please get back to us with above details which will be helpful for us to validate further and provide a solution as soon as possible. 

Regards, 
Rajapandiyan S

Loader.
Up arrow icon