Resend last query?

Hello.

Is it possible to  programmatically re-send last executed query?
So basically if I want to add a button on UI which would "Refresh data" how should I do it?
Working with React Scheduler if it helps.

Thanks!

3 Replies 1 reply marked as answer

RV Ravikumar Venkatesan Syncfusion Team August 28, 2020 03:22 PM UTC

Hi Kostya, 
  
Greetings from Syncfusion support. 
  
  
Is it possible to programmatically re-send the last executed query? 
  
We have validated your above query at our end. The last executed query is not changed until we change it for the GET requests and the last executed query is changed for the every POST and BATCH requests. 
  
  
if I want to add a button on UI which would "Refresh data" how should I do it? 
  
We have validated your above query at our end. You can refresh the schedule events data with the help of a button like the below code. We have prepared a sample for your reference and it can be available below. 
  
[index.js] 
export class LocalData extends SampleBase { 
  constructor() { 
    super(...arguments); 
    this.data = extend([], dataSource.zooEventsData, null, true); 
  } 
  
  onClick() { 
    this.scheduleObj.refreshEvents(); 
  } 
  
  render() { 
    return (<div className='schedule-control-section'> 
      <div className='col-lg-12 control-section'> 
        <div className='control-wrapper'> 
          <ButtonComponent id='refresh' title='refresh' onClick={this.onClick.bind(this)}>Refresh schedule data</ButtonComponent> 
          <ScheduleComponent width='100%' height='650px' selectedDate={new Date(2018, 1, 15)} ref={=> this.scheduleObj = t} eventSettings={{ dataSource: this.data }} eventRendered={this.onEventRendered.bind(this)}> 
            <Inject services={[Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop]} /> 
          </ScheduleComponent> 
        </div> 
      </div> 
    </div>); 
  } 
} 
  
  
Kindly try the above sample and get back to us if you need any further assistance. 
  
  
Regards, 
Ravikumar Venkatesan 


Marked as answer

KT Kostya Tkachuk November 30, 2020 01:44 PM UTC

Hi, Ravikumar!

Took me too long to get back to this.
Sorry, for the late reply.

Thanks a lot! Works as a charm!

Regards,
Kostya


NR Nevitha Ravi Syncfusion Team December 1, 2020 04:49 AM UTC

Hi Kostya, 

You are most welcome, we are glad that our solution helped you. Please get back to us if you need any further assistance. 

Regards, 
Nevitha 


Loader.
Up arrow icon