Joomla + dhtmlxCalendar & custom table

Hi,

I need to implement dhtmlx Calendar on a Joomla site, but I need to operate on another table instead of ‘events_rec’. What’s the best approach?

Idea #1: alter my custom component code to read and store date in ‘events_rec’ along with inside its own table. I think this is doable/easy - but am I missing something?

Idea #2: alter dxhtmlxCalendar to read from my custom table. From what I’ve read on the forums though this may be problematic.

Thoughts?

Thanks,
Chris

If you need to change only name of table - you can just run text replace on existing component’s files and replace events_rec with new name - there will not be any problems.

If you want to change the structure of table - it will require a more complex steps.

One of the things the custom component tracks is ‘jobs’. Each of these ‘jobs’ has info like ‘customer id’, ‘address’, ‘start’, ‘end’ etc. Right now, I’ve pulled the table structure of dhxtmlcCalendar (DC) into the jobs model and added ‘event_id’ to the jobs table - now saving on the jobs model will create a new row in ‘events_rec’ or modify the row if it exists.

Editing a job is a little trickier, since I have no desire to sync up the 10K+ existing rows - so I check for a matching row in ‘events_rec’ and if it’s not found, fall back to the existing start/end info in the jobs table. So it’s not super-efficient since the start/end data is recorded in two separate tables, but it works fairly well and the number of people accessing the site will be fairly low so I’m not too worried about overhead.

This may be good enough for my purposes - however, it might be nice to make certain DC items (the ones created by the ‘jobs’ model) to be non-editable. Some would still be draggable, resizable, etc - but the ‘text’ field would be immutable through the DC interface. Some would be ‘locked’ - no changes allowed at all (think the Joomla ‘checked out’ state). Any pointers on where to look? How tough will it be to add one or two fields at the end of the DC table?

I’ve poked around a little bit in the codebase dir, but I’m not really sure where to begin - so any ideas at all are appreciated :slight_smile:

Thanks,
Chris

Are you using any benefits of joomla integration, such as user-base access rights?

It may be a lot easier to use the standalone scheduler. The only thing which you will lost - easy access to current joomla user settings. But you will be able to configure scheduler directly, which means you can use custom table and fields, define readonly logic and etc.

docs.dhtmlx.com/doku.php?id=dhtm … #connector
docs.dhtmlx.com/doku.php?id=dhtm … ehaviors&s[]=readonly#readonly_view