Showing posts with label Drop. Show all posts
Showing posts with label Drop. Show all posts

Thursday, February 28, 2008

Klok update for AIR 1.0


EXISTING USERS READ THIS BEFORE INSTALLING
See the section below on "Migrating to the new version"

Over the last few days, I have recieved at least a hundred emails asking when an update for AIR 1.0 would be available. I am happy to say, that it is now ready. While there is still much work to be done, there are some new things worth checking out.

Details are below but if you don't feel like reading, the new features are:

  • Weekly timesheet excel export
  • Totals on the week view screen
  • Selectable week/month on the reports screen
  • Archive feature
  • Un-delete across multiple sessions

First of all, the data format on the back end has changed a bit. This change allowed me to now store items in the trash between sessions. So you can now un-delete something even if you have closed Klok. To empty the trash, just click on the trash can and click "Empty Trash".

I have also added an Archive feature which will allow you to hide clients/projects/tasks from the tree view, the week view and all reporting. Simply drag a client, project or task and drop it on the file cabinet icon in the bottom left. To un-archive, double click the file cabinet and pick the items you want. When archiving an item, all sub items are also archived. When un-archiving all parent items are un-archived.

You will also notice that in the place where the calendar used to be, there is now a "Common Tasks" list (currently with only one item in it). Probably the most common feature request over the last few months has been for better reporting. So in a first step to getting to something useful, I have added the View/Export Weekly Timesheet feature. Clicking that link, will launch a preview of the timesheet for the selected week. This gives you daily and weekly totals for each task, plus totals overall. To get this out of Klok and into some other project (Excel for example), you can just drag the table of data onto your desktop or directly into excel. From there, you can do with it what you please.

Speaking of totals, I have also added daily totals at the bottom of the week view. I realize there is a slight alignment problem which I will fix in the next update.

If you were wondering what happened to the calendar that was on the left, I found that it wasn't as useful as what is going to be in the common tasks list. So, I moved it into a dropdown above the week view where it shows the currently selected date. Just click the little calendar icon.

I have also moved the zooming feature which was down the right hand side of the screen. The complaint was that it wasn't obvious. So it is now in the area right above the week view.

On the old reports screen I haven't changed much except for adding the ability to pick a week or month other than the current and previous ones. The bug where "this week" and "next week" were launching the wrong reports has also been fixed.

Migrating to the new version
Before installing backup you old data file called data.dat. The location of this file differs on different operating systems.
On Windows XP it is C:\Documents and Settings\[UserName]\Application Data\TimeTracker\Local Store\data.dat On Windows Vista it is: C:\Users\[UserName]\AppData\Roaming\TimeTracker\Local Store\data.dat

After you install the new version, you will want to copy your backed up data file into the new install location which would be:
XP: C:\Documents and Settings\[UserName]\Application Data\Klok.AF6B2973D903BFAE0589C27890FE0146C233490A.1\Local Store\
Vista: C:\Users\[UserName]\AppData\Roaming\Klok.AF6B2973D903BFAE0589C27890FE0146C233490A.1\Local Store

If that folder has a file called klok.dat, delete it. DO NOT rename the data.dat file to klok.dat. Then next time you launch Klok, it will automatically migrate the data from the old format to the new format.

As usual, post any comments, suggestions or bugs here.

Saturday, July 14, 2007

Dragging and dropping from a tree in Flex

This might be common knowledge to some but it took me a bit to figure this out. Suppose you have a tree of items such as a hierarchical list of folders and you want to enable the user to drag an item out of the tree onto a trashcan.


Here is a snippet of the code:



<mx:Tree x="10" top="10" bottom="75" width="200" id="tree"
labelField="name" dragEnabled="true"/>

<local:TrashCan id="trash" dragdrop="deleteItem(event)"
dragenter="doDragEnter(event)"/>

...


<mx:Script>
private function doDragEnter(event:DragEvent):void {
var dragInitiator:TrashCan=TrashCan(event.currentTarget);
DragManager.acceptDragDrop(dragInitiator);
}

private function deleteItem(event:DragEvent) : void {
//do the actual delete here.
}
</mx:Script>

When you run this code everything works except you get an error. The problem was that the default behavior when dragging from a tree expects that you are dropping the item into a tree, either the same tree or a different one. Since my TrashCan was not a subclass of Tree the error was being thrown.


The simple solution is to tell the tree to skip the default behavior. The way you do it is to add dragComplete="event.preventDefault()" to the Tree.