[OPEN-177] Drop from external source

Request new features or modifications for Extensible components

[OPEN-177] Drop from external source

Postby kusyn » Mon Feb 14, 2011 6:44 am

Hi Brian.
I'm working on Calendar with Unplanned Events grid (events with no Start/End). It's quite difficult to implement it without changing Calendar DD (at least I didn't find any acceptable solution).
But - after few attempts I found solution modifying Calendar DD - concretely by adding a little piece of code with new DD action type to onNodeDrop function in Ext.ensible.cal.DayViewDropZone.

Code: Select all
onNodeDrop : function(n, dd, e, data){
        if(n && data){
            if(data.type == 'eventadd_external'){
                //Ext.ensible.cal.EventRecord
                var rec = data.data; 
                rec.set(Ext.ensible.cal.EventMappings.StartDate.name, n.date);
                rec.set(Ext.ensible.cal.EventMappings.EndDate.name, n.date.add(Date.DAY, rec.length.days)).add(Date.HOUR, rec.length.hours));
                this.view.onEventAdd(null, rec);
                this.onCalendarDragComplete();
                delete this.dragOffset;
                return true;
            }
....


Please take a look at this. I'm quite sure that external Drop is quite usable feature it will be better if you take care about this and implement it properly (at least to secure compatibility with higher versions).
kusyn
 
Posts: 10
Joined: Fri Jan 07, 2011 2:44 pm

Re: Drop from external source

Postby brian.moeskau » Mon Feb 14, 2011 11:34 am

Thanks -- can you please explain a bit more? What do you mean events with no start/end dates -- how is that possible? Can you fully explain the use case? Also, where is the new DD type being set in your code and what does the data param look like? I'm unclear exactly what this code is supposed to do.
Personal Blog: Extraneous / Twitter: @bmoeskau / Meetup: Austin Bleeding Edge Web
User avatar
brian.moeskau
Site Admin
Site Admin
 
Posts: 1344
Joined: Sat Sep 18, 2010 5:00 pm
Location: Austin, Texas

Re: [DISCUSS] Drop from external source

Postby kusyn » Tue Feb 15, 2011 2:13 am

Well one example of the use case - superior can assign tasks to subordinates (tasks like call, mail, make appointment etc) these taks will be shown in the grid with unplanned events and subordinate can plan these task concretely. These tasks are prepared (title, assumed duration, notes, additional info), but are not planned yet (no start/end set), you can drag them from grid and drop them to the callendar (and set the start and end based on assumed duration set to the task).

To make this working I add that few lines to Ext.ensible.cal.DayViewDropZone as I mentioned them in first post, and set grid's drag zone

Code: Select all
grid.dragZone = new Ext.grid.GridDragZone(grid, {
                        ddGroup : 'calendarDD',

                        getDragData: function(e) {
                            var target = Ext.lib.Event.getTarget(e);
                            var rec = grid.store.getAt(grid.view.findRowIndex(target));

                            var thisProxy = Ext.ensible.cal._statusProxyInstance;

                            var newDDel = document.createElement("div");
                            this.ddel.className = 'jibber-calendar-week-bd-evt-' + rec.data['EventId'];

                            return {
                               ddel:this.ddel,
                               item:target,
                               proxy: thisProxy,
                               data: rec,
                               type: 'eventadd_external'
                            };
                        }
                    })


That's all - I know it's only a piece of code (and also it's implemented only in DayView) but it contains all changes I made. I can't send you code of our whole app, but if you need I can make a simple example, if it's necessary .
kusyn
 
Posts: 10
Joined: Fri Jan 07, 2011 2:44 pm

Re: [DISCUSS] Drop from external source

Postby brian.moeskau » Tue Feb 15, 2011 2:29 am

"you can drag them from grid and drop them to the calendar..."

Ah, I see -- I didn't understand before that these events were originating from a separate GridPanel. You mentioned a grid now that I re-read it, but I missed that bit.

Yes, I'll check this out soon. Several other people have requested examples of DnD between the calendar and other components so your use case would provide a perfect example to implement as a demo. Thanks for sharing!
Personal Blog: Extraneous / Twitter: @bmoeskau / Meetup: Austin Bleeding Edge Web
User avatar
brian.moeskau
Site Admin
Site Admin
 
Posts: 1344
Joined: Sat Sep 18, 2010 5:00 pm
Location: Austin, Texas

Re: [OPEN-177] Drop from external source

Postby kusyn » Tue Apr 26, 2011 2:33 am

Hi Brian, any progress? Have you any propper example?
kusyn
 
Posts: 10
Joined: Fri Jan 07, 2011 2:44 pm

Re: [OPEN-177] Drop from external source

Postby brian.moeskau » Tue Apr 26, 2011 6:47 am

If you get the latest from Github there is a proof-of-concept example of dragging from a grid to a calendar. It currently requires a lot of overrides to make it work, so is not a good long-term solution, but shows that it will be possible. I'll still have to do some work to make it generically possible via the standard API.
Personal Blog: Extraneous / Twitter: @bmoeskau / Meetup: Austin Bleeding Edge Web
User avatar
brian.moeskau
Site Admin
Site Admin
 
Posts: 1344
Joined: Sat Sep 18, 2010 5:00 pm
Location: Austin, Texas

Re: [OPEN-177] Drop from external source

Postby kusyn » Wed Apr 27, 2011 12:06 am

Great - I'll take a look.
kusyn
 
Posts: 10
Joined: Fri Jan 07, 2011 2:44 pm

Re: [OPEN-177] Drop from external source

Postby jaiishankar » Tue Jul 12, 2011 10:22 am

Is this supports 3.3.1 too?
jaiishankar
 
Posts: 12
Joined: Thu Jun 16, 2011 10:56 am
Location: Mclean, Va

Re: [OPEN-177] Drop from external source

Postby brian.moeskau » Tue Jul 12, 2011 10:43 am

jaiishankar wrote:Is this supports 3.3.1 too?

I don't understand the question. You mean is this example in Extensible 1.0, which works under Ext 3.3.1? If so the answer is yes.
Personal Blog: Extraneous / Twitter: @bmoeskau / Meetup: Austin Bleeding Edge Web
User avatar
brian.moeskau
Site Admin
Site Admin
 
Posts: 1344
Joined: Sat Sep 18, 2010 5:00 pm
Location: Austin, Texas

Re: [OPEN-177] Drop from external source

Postby jaiishankar » Mon Nov 14, 2011 1:53 pm

I used the overrides as mentioned in the example, it works fine in all browsers but fails in IE8 and IE7. I am using extjs 3.3.1. Any suggestions?

PS: It works good in IE9 too.
jaiishankar
 
Posts: 12
Joined: Thu Jun 16, 2011 10:56 am
Location: Mclean, Va

Next

Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron