We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Add additional parameter in Datamanager.

Hey Team!
I want to add additional parameter in Datamanager adaptor whenever my app hits url or crudUrl of datamanager, i.e. whenever app fetches data for first time ' http://localhost:5000/get ' or performing crud operation ' http://localhost:5000/update ', I want to add extra parameters.


function Calendar() {
    const onDragStart = (arg) => {
        arg.navigation.enable = true;
    }

    let dataManager = new DataManager({
        url: 'http://localhost:5000/get',
        crudUrl: 'http://localhost:5000/update',
        adaptor: new UrlAdaptor(),
        crossDomain: true
    });

    return (
        <div className="scheduler">
            <Header title="Calendar" />
            <ScheduleComponent
                height="85%"
                selectedDate={new Date(2021, 0, 10)}
                eventSettings={{ dataSource: dataManager }}
                dragStart={onDragStart}
            >
                <ViewsDirective>
                    {['Day', 'Week', 'WorkWeek', 'Month', 'Agenda'].map((item) => <ViewDirective key={item} option={item} />)}
                </ViewsDirective>
                <Inject services={[Day, Week, WorkWeek, Month, Agenda, Resize, DragAndDrop]} />
            </ScheduleComponent>
        </div>
    )
}



5 Replies 1 reply marked as answer

SA Salokya May 2, 2023 02:19 AM UTC

let dataManager = new DataManager({
url: 'http://localhost:5000/get',
crudUrl: 'http://localhost:5000/update',
adaptor: new UrlAdaptor(),
crossDomain: true
});

let dataQuery = new Query().addParams('email', 'user@user.com');
const eventSettings = { dataSource: dataManager, query: dataQuery };


I tried this way, but the request is having repeating info, like you can email, startDate and endDate is repeating ->

{

params: {

  email: 'user@user.com',

  StartDate: '2021-01-09T18:30:00.000Z',

  EndDate: '2021-01-16T18:30:00.000Z'

},

   email: 'user@user.com',

   StartDate: '2021-01-09T18:30:00.000Z',

   EndDate: '2021-01-16T18:30:00.000Z'

}



SA Salokya May 2, 2023 02:19 AM UTC

Also can I use fetch API or axios to directly perform crud operations in JSON form? If so can you give an example in React.js?



VD Vinitha Devi Murugan Syncfusion Team May 4, 2023 02:48 PM UTC


Marked as answer

SA Salokya May 4, 2023 03:45 PM UTC

Thank you!



VD Vinitha Devi Murugan Syncfusion Team May 5, 2023 06:05 AM UTC

You are most welcome, Salokya


Loader.
Up arrow icon