2009

Jun

5

Av

Detta inlägg kommer att vara på engelska och du förstår snart varför när du läser det. Om du behöver översätta till svenska kan du använda dig av Google Translate.

Det här exemplet visades av John Sindelar på FileMakers utvecklarkonferens i San Francisco 14 augusti 2009 som ett av de “the coolest FileMaker work we’ve seen over the past year”.

Have you ever wished to be able to drag and extend a bar in a Gantt schema? Or use a slider? Now you can!

I was watching Todd Geists excellent way to use conditional formatting to show bars in a graph and at the end of the podcast he gave the audience a challenge to make it possible to drag and extend or move a bar in a Gantt schema. Without any plugins of course. I took the challenge and you can read about the solution in this post.

A while ago we wrote about drag and drop within a portal, and between portals. This solution takes drag and drop a bit further.

The solution depends, of course, on script triggers and can only be used in FileMaker 10. Besides extending or moving the bar, you can drag it from one record to another.

Gantt

I start with the database used in the solution and define some fields:

Max = number (start of the bar)
Min = number (end of the bar)
Bar = repeating field with 100 repeats
Sum = sum field that sums the bar field

Put the field Bar in the layout with all repetitions showed and make the field select all if you click in it.

Then attach the following formula to conditional formatting to show the colour of the bar:

If (Extend(DragAndDropGant::Min) <= Get ( CalculationRepetitionNumber ) and 
Extend(DragAndDropGant::Max) >= Get ( CalculationRepetitionNumber ); 1; 0)

Add a second formula to colour the ends (the first and last field) of the bar:

If (Extend(DragAndDropGant::Min) = Get ( CalculationRepetitionNumber )  or 
Extend(DragAndDropGant::Max) = Get ( CalculationRepetitionNumber ); 1; 0)

Next you create a script like this: (Grab it from the example file you can download below.)

ScriptDef

The last thing you do is to connect a script trigger event to the bar field as an OnObjectEnter event that will execute the script.

Download sample

En kommentar till ”Drag and drop for Gantt”

  1. Simon Danielsson

    Riktigt nice!

    Och med datum i en kalender blir det ännu bättre!
    Har ni gjort det?
    Kan jag beställa?

    Reply

Skriv en kommentar

  • (will not be published)
  • × 8 = sixteen

Läs också: