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.
Unfortunately, activation email could not send to your email. Please try again.

categorizeSettings doesn't work with remote datasource

Thread ID:

Created:

Updated:

Platform:

Replies:

119908 Aug 12,2015 11:09 AM Aug 14,2015 07:35 AM JavaScript 3
loading
Tags: ejSchedule
Andreas Schenk
Asked On August 12, 2015 11:09 AM

Hi!

in the last couple of days I tried to configure the categorizeSettings of ejSchedule to get its data from a remote data source (JSON), but it doesn't work.

First I tried to bind the categorizeSettings locally (copied the JSON return string into a Javascript Object) - and everything works fine. But if I swap the datasource to my datamanager, nothing happens. The url will never be called (and I also do not get any js error messages) :-(

here is an extract of my source code:

var dataManagerCat = ej.DataManager({ url: "/Termine/GetDienstleistungen", adaptor: 'UrlAdaptor' });

 $("#calendar").ejSchedule({...
categorizeSettings:
                   {
                       enable: true,
                       allowMultiple: true,
                       dataSource: dataManagerCat,
                       text: "Name", id: "DienstleistungID", color: "DienstleistungFarbe", fontColor: "DienstleistungFarbeBorder"
                   },
...
});

Sarath Kumar P K [Syncfusion]
Replied On August 13, 2015 08:43 AM

Hi Andreas,


Thank you for using Syncfusion products.


We have prepared a schedule sample to bind the categorize collection from database using controller action which can be downloaded from the following location.

http://www.syncfusion.com/downloads/support/forum/119908/ze/ScheduleCRUD-50086585

 

In the above sample we have used dataManager to get the categorize collection and also queried that collection to assign it to the "categorizeSettings.dataSource" value. Please refer the following code snippet.

 

<code>

[Index.cshtml]

 

  var Category = ej.DataManager({

            url: "/Home/GetCategory",    //Assign the url path to get category data

            offline: false

        });

        Category.adaptor = new ej.UrlAdaptor();

        var categoryCollection = Category.executeQuery(ej.Query().take(10));    //Get the category collection using query

        categoryCollection.done(function (e) {

            var schObj = $("#Schedule1").data("ejSchedule");

            schObj.option("categorizeSettings.dataSource", e.result);       //Assign the collection to categorize dataSource

        });


[HomeController.cs]

 

public JsonResult GetCategory()

        {

            IEnumerable data = new ScheduleDataDataContext().Categories.Take(100);    //Get the database value

           return Json(data, JsonRequestBehavior.AllowGet);

        }

</code>


Kindly try the above provided sample and let us know if you need any further assistance.


Regards,

Sarath Kumar P K


Andreas Schenk
Replied On August 13, 2015 10:02 AM

Hi Sarath,

thank you so much - this works like a charm. What I missed was to query the datamanager separatly. I thought this is done by scheduler component (like it does it for owners and appointments...). Did I miss any documentation here? Because I didn't find anything which describes your approach for the categorizeSetting... :)

BR
Andreas

Sarath Kumar P K [Syncfusion]
Replied On August 14, 2015 07:35 AM

Hi Andreas,


Thanks for your update.


We are glad to hear that the provided solution has met with your requirement. We regret for such inconvenience that the default way of using datamanager with owners and appointments doesn’t worked on categoriesSettings due to some internal issue which will be fixed and included in our upcoming release. Regarding the approach which we have suggested you in our previous update for categorySettings, we will consider and include the necessary details to achieve this scenario in our UG documentation.

 

Please let us know, if you require any further assistance. As always, we will be happy to assist you.


Regards,

Sarath Kumar P K


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;