Priority Listing
Posted: Mon Dec 18, 2006 8:23 am
Hey all,
Now here is the most pointless excercise I have come across to date.
Here goes, I'm building a task log for internal use and the boss wants to me implement priority listing. Basically when a new task is added, based on current tasks, a particular priority number can be set, anywhere from 1 to a million (not Very High to Very Low, because that would be a normal way to do things...), what it needs to do, is that if a task is already set to 1, and a new task is added which is also 1, the previous task which was allocated 1 would move to 2, and 2 to 3 and so on. In the event of a task deletion the gap left by the deleted task would also adjust to the correct number and follow through, so all tasks will be listed from 1 to whatever it gets to.
So after that big ramble, apologies, my troubles are with the number overwritting and adjusting, I have absolutely no code to show you because I have no idea how to even start it. Can it be done perhaps by somehow giving an ID to each new row created?
Now here is the most pointless excercise I have come across to date.
Here goes, I'm building a task log for internal use and the boss wants to me implement priority listing. Basically when a new task is added, based on current tasks, a particular priority number can be set, anywhere from 1 to a million (not Very High to Very Low, because that would be a normal way to do things...), what it needs to do, is that if a task is already set to 1, and a new task is added which is also 1, the previous task which was allocated 1 would move to 2, and 2 to 3 and so on. In the event of a task deletion the gap left by the deleted task would also adjust to the correct number and follow through, so all tasks will be listed from 1 to whatever it gets to.
So after that big ramble, apologies, my troubles are with the number overwritting and adjusting, I have absolutely no code to show you because I have no idea how to even start it. Can it be done perhaps by somehow giving an ID to each new row created?