customd / jquery-calendar

A full day, week, and resource calendar for use with jQuery.
MIT License
62 stars 26 forks source link

Can i get the master list for the creating events and can i also add id instead of uid in the events ? #5

Closed krisnakp closed 11 years ago

krisnakp commented 11 years ago

Hi, Can anyone help me to solve my doubt about the below mentioned issue. Can i get the master list for the creating events and can i also add id instead of uid in the events ? Please help me out asap..... Thanks in advance

Thanks -Krishna K P

samatcd commented 11 years ago

Hi there.

The full list of properties available for creating events are as follows. In fact, your object may contain more keys than this, but these are the ones the plugin will read, write, and react to. The rest will be returned to you whenever you receive an event object.

{
    uid        : 1,
    begins     : '2011-08-04 10:00:00',
    ends       : '2011-08-04 11:30:00',
    notes      : 'Testing...',
    color      : 'purple',
    title      : 'The Title!'
}

That means you could add an 'id' property, but it wouldn't mean anything as far as the plugin is concerned. You still need to provide the uid, which MUST be unique over all event objects displayed in the calendar.

krisnakp commented 11 years ago

thanks a lot sam... :)

krisnakp commented 11 years ago

Hi Sam,

May i know any way to get identified to each and every event in the calendar. so that we can use automation test to check for all the events populated on the calendar. So if can we provide any id to identify the events and that should be customizable (ID). And that helps in the automation testing for the jquery calender.

Thanks -Krishna K P

samatcd commented 11 years ago

At present, there is no public way to get all events added to the calendar, however you can presently use this:

$('#your_id').data('cal').cache.events

This should be considered a private api, which will be subject to change in the future. At some point, I'll add a public method so you can get all events added, or all events for the currently displayed timespan on the calendar, but this should suit your purposes for now.

Your custom event properties WONT be available on this event object — it's used internally to calculate & store values against, so you'd need to maintain your own list of objects which you can reference by the 'uid' field if you need to use any other properties.

krisnakp commented 11 years ago

Hi Sam,

I am looking for assigning 'id' attribute to each event div generated by the calendar api. This will help in automation testing as the automation tool we use can easily identify any element in the HTML dom using standard attributes like 'id' or 'name' etc. I understand that uid property that I pass with every event definition is listed as attribute named 'data-id' for the generated

but that doesn't helps me much as it is not a standard HTML attribute.

My requirement is(Last one is optional):

  • Each event
    should be uniquely identifiable by 'id' attribute.
  • I should be able to pass the id value while defining the event(just like uid property).
  • If no value is specified for id during definition of event then api should auto-generate and assign sequential numbers as id for each event
    .

Please help me with this.

Thanks -Krishna K P