Page Index Toggle Pages: [1] 2 3  Send TopicPrint
Very Hot Topic (More than 25 Replies) New questions, about localization and value sorting (Read 35867 times)
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
New questions, about localization and value sorting
Mar 4th, 2014 at 5:32pm
Print Post  
Hi there,

I got two problems that I tried to solve but couldn't.

1. In the calendar control, if I create new appointment by clicking the calendar, and let's say I modified the location textbox into a dropdownlist, which I could select 5 different types of appointments. Each appointment has its color(style.Brush.Color = Color.XXX). How can I apply this? So once I create a new appointment, the time bar color will be based on the appointment type.

2. If I read the schedule from database, let's say now in the database I have 11 appointments, the contacts name are from A1 to A6, B1 to B5, but in database the appointments are not sorted from A1 to A6, B1 to B5, maybe it's like A2, B3, A5, A3, B2, B1 etc. But I would like to display the schedule from A1 to A6, B1 to B5 on the calendar. Especially, if I create new contact on the page, let's say I create new contact A7, originally contact A7 will appear under B5, but I would like to sort it under A6, above B1.

Any idea about them?

Thanks in advance!
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: New questions, about localization and value sorting
Reply #1 - Mar 5th, 2014 at 7:44am
Print Post  
Hi,

1. This topic from the documentation explains how items can be styled. In your case, you can define different CSS classes for the different types of appointments you have and then, when creating new or modifying existing appointments, just set the Item.CssClass property to the correct class. You can read more on how the control uses CSS here. The 'Client Events' sample shows how this can be achieved.

2. The control doesn't provide a built-in functionallity for sorting the resource collections. The resources are displayed in the order they are added to the calendar's collection. You can use the collection's Insert method to add the new items to their correct positions.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: New questions, about localization and value sorting
Reply #2 - Mar 5th, 2014 at 3:11pm
Print Post  
That's what I am asking, the "New Appointment" page is built-in in the calendar control, I know how to add different color to the time bar if the appointment is from external data resources. But if the appointment is from the built-in "New Appointment" page, the dropdownlist contains 5 types of appointments (I modified the original location textbox into a dropdownlist which has 5 values regarding to the 5 appointment types ), for each type, it has "value" and "text". Let's say the values of types are from 1 to 5, how can I associate the colors with specified type?

Lyubo wrote on Mar 5th, 2014 at 7:44am:
Hi,

1. This topic from the documentation explains how items can be styled. In your case, you can define different CSS classes for the different types of appointments you have and then, when creating new or modifying existing appointments, just set the Item.CssClass property to the correct class. You can read more on how the control uses CSS here. The 'Client Events' sample shows how this can be achieved.

2. The control doesn't provide a built-in functionallity for sorting the resource collections. The resources are displayed in the order they are added to the calendar's collection. You can use the collection's Insert method to add the new items to their correct positions.

Regards,
Lyubo

  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: New questions, about localization and value sorting
Reply #3 - Mar 6th, 2014 at 7:18am
Print Post  
You can achieve this by handling the itemCreating event on the client. In the handler, you can decide which CSS class to assign to the new item, depending on the item.location values. This is shown in the sample project I suggested above.
  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: New questions, about localization and value sorting
Reply #4 - Mar 11th, 2014 at 1:57pm
Print Post  
Thank you I achieved that on my calendar.

So right now I am trying to connect my calendar with oracle database. So I could read schedule from database, and if I create new schedule/appointment/contacts on the calendar control, it can be saved in database.

The new event/appointment function are conducted in Javascript, so can you please explain a little bit about how to save all the schedule/appointments into  oracle database?

Thank you

Lyubo wrote on Mar 6th, 2014 at 7:18am:
You can achieve this by handling the itemCreating event on the client. In the handler, you can decide which CSS class to assign to the new item, depending on the item.location values. This is shown in the sample project I suggested above.

  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: New questions, about localization and value sorting
Reply #5 - Mar 11th, 2014 at 2:42pm
Print Post  
Hi,

Appointments which are created on the client through the popup forms are synchronized with the server-side Schedule on PostBack automatically. You can choose one of two postback methods by setting the Calendar.AutoPostBack property:

* Set it true to enable automatic postbacks after each change to the Schedule. If there are many successive changes to the schedule - creating, modifying, deleting items - this may not be the most efficient approach, as frequent postbacks can lead to slow performance.
* Set it to false (that's the default) if you wish to trigger a PostBack manually. This approach is preferred if you expect frequent changes to the schedule. That way all the changes between postbacks are sent to the server in one go.

After the schedule has synchronized, you can access the appointments through the Schedule.Items collection and save them in your database.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: New questions, about localization and value sorting
Reply #6 - Mar 12th, 2014 at 1:26pm
Print Post  
Great, thank you very much Lyubo

Lyubo wrote on Mar 11th, 2014 at 2:42pm:
Hi,

Appointments which are created on the client through the popup forms are synchronized with the server-side Schedule on PostBack automatically. You can choose one of two postback methods by setting the Calendar.AutoPostBack property:

* Set it true to enable automatic postbacks after each change to the Schedule. If there are many successive changes to the schedule - creating, modifying, deleting items - this may not be the most efficient approach, as frequent postbacks can lead to slow performance.
* Set it to false (that's the default) if you wish to trigger a PostBack manually. This approach is preferred if you expect frequent changes to the schedule. That way all the changes between postbacks are sent to the server in one go.

After the schedule has synchronized, you can access the appointments through the Schedule.Items collection and save them in your database.

Regards,
Lyubo

  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: New questions, about localization and value sorting
Reply #7 - Mar 12th, 2014 at 2:48pm
Print Post  
So let's say if I had multiple schedules on one calendar, then I created some new schedules and edited some existing schedules, how to insert each schedule as record one by one into database?

Use 'foreach' to loop the calendar.Schedule.item collection?

Lyubo wrote on Mar 11th, 2014 at 2:42pm:
Hi,

Appointments which are created on the client through the popup forms are synchronized with the server-side Schedule on PostBack automatically. You can choose one of two postback methods by setting the Calendar.AutoPostBack property:

* Set it true to enable automatic postbacks after each change to the Schedule. If there are many successive changes to the schedule - creating, modifying, deleting items - this may not be the most efficient approach, as frequent postbacks can lead to slow performance.
* Set it to false (that's the default) if you wish to trigger a PostBack manually. This approach is preferred if you expect frequent changes to the schedule. That way all the changes between postbacks are sent to the server in one go.

After the schedule has synchronized, you can access the appointments through the Schedule.Items collection and save them in your database.

Regards,
Lyubo

  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: New questions, about localization and value sorting
Reply #8 - Mar 13th, 2014 at 12:28pm
Print Post  
Yes, you can use a foreach loop and enumerate the Schedule.Items collection. However it doesn't contain information whether the items have been created, edited or haven't changed since the last PostBack so you'll need some method of verification about that. You could use the server-side events ItemCreated, ItemModified, ItemDeleted, ItemInplaceEdited. After PostBack they will be raised for all the created, modified and removed items in the schedule.

You may need some kind of unique id to identify an appointment within the database - you can use the Appointment.Tag property for that. It is designed to store custom data for the appointment.
  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: New questions, about localization and value sorting
Reply #9 - Mar 13th, 2014 at 1:32pm
Print Post  
Thank you very much, I will try that
Lyubo wrote on Mar 13th, 2014 at 12:28pm:
Yes, you can use a foreach loop and enumerate the Schedule.Items collection. However it doesn't contain information whether the items have been created, edited or haven't changed since the last PostBack so you'll need some method of verification about that. You could use the server-side events ItemCreated, ItemModified, ItemDeleted, ItemInplaceEdited. After PostBack they will be raised for all the created, modified and removed items in the schedule.

You may need some kind of unique id to identify an appointment within the database - you can use the Appointment.Tag property for that. It is designed to store custom data for the appointment.

  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: New questions, about localization and value sorting
Reply #10 - Mar 20th, 2014 at 1:17pm
Print Post  
I tried couple of times to post the new event to insert them into oracle but failed...

Can you give me an example?

Say I have created contacts A, B, C, D, E.  A has 3 schedules which event types are 1,2,3. Then B has 3 schedules then C either, D maybe has 5 schedules then E has 2 schedules.

Now  how to insert/update them into oracle?

Big thx..

Lyubo wrote on Mar 13th, 2014 at 12:28pm:
Yes, you can use a foreach loop and enumerate the Schedule.Items collection. However it doesn't contain information whether the items have been created, edited or haven't changed since the last PostBack so you'll need some method of verification about that. You could use the server-side events ItemCreated, ItemModified, ItemDeleted, ItemInplaceEdited. After PostBack they will be raised for all the created, modified and removed items in the schedule.

You may need some kind of unique id to identify an appointment within the database - you can use the Appointment.Tag property for that. It is designed to store custom data for the appointment.

  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: New questions, about localization and value sorting
Reply #11 - Mar 20th, 2014 at 2:06pm
Print Post  
Hi,

What exactly fails? Is there any error message or exception? When are you trying to update the database - on postback or in a response to an item event?

Could you paste here the code you're using to insert the appointments?

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: New questions, about localization and value sorting
Reply #12 - Mar 20th, 2014 at 3:00pm
Print Post  
My problem is , for insert/update/delete I have stored procedure to accomplish that.

In the calendar, let's say I have contacts A, B, C, D, E, and each one has several appointments. Line one has contact A, its appointments are listed on the same line. And so on so forth...

But in my oracle, records are row by row. EXP contact A with appointment 1 is on row 1, contact A with appointment 2 is on row 2....so on so forth.

I tried to post all the insert/update/delete action back into the stored procedure but couldn't achieve  that

Lyubo wrote on Mar 20th, 2014 at 2:06pm:
Hi,

What exactly fails? Is there any error message or exception? When are you trying to update the database - on postback or in a response to an item event?

Could you paste here the code you're using to insert the appointments?

Regards,
Lyubo

  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: New questions, about localization and value sorting
Reply #13 - Mar 21st, 2014 at 12:58pm
Print Post  
Hi,

Check out this sample application: https://mindfusion.eu/_samples/WebPlanner.Database.zip.

It demonstrates one way to synchronize the planner's schedule with an underlying database.
The application uses SQL Compact Edition 4.0 as datastore, but the principle will remain the same with Oracle, too.

The database is updated as a response to an ItemCreated, ItemModified, ItemInplaceEdited or ItemDeleted event. The appointments and contacts are matched in the database by the auto-id, which is cached in the Appointment.Tag property.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: New questions, about localization and value sorting
Reply #14 - Mar 21st, 2014 at 1:21pm
Print Post  
Appreciate Lyubo, I'll check

Lyubo wrote on Mar 21st, 2014 at 12:58pm:
Hi,

Check out this sample application: https://mindfusion.eu/_samples/WebPlanner.Database.zip.

It demonstrates one way to synchronize the planner's schedule with an underlying database.
The application uses SQL Compact Edition 4.0 as datastore, but the principle will remain the same with Oracle, too.

The database is updated as a response to an ItemCreated, ItemModified, ItemInplaceEdited or ItemDeleted event. The appointments and contacts are matched in the database by the auto-id, which is cached in the Appointment.Tag property.

Regards,
Lyubo

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 3 
Send TopicPrint