Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-13-2012, 01:29 PM   PM User | #1
willise
New to the CF scene

 
Join Date: Apr 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
willise is an unknown quantity at this point
Javascript question from an AS3 convert

Hi all,

I created a program for my company that allows employees to log in, and make their annual leave selections. It was made in Flash Builder with AS3. It contains a datagrid with 7 available leave slots for each day of the year. Employees click on an available slot and their name in inserted. We go through this process 4 times, with each employee selecting 5 days per round until they have selected up to 20 days of annual leave. We use company seniority to rank the order in which the employees pick. I hope I've explained that clearly enough to have someone help me with my question

Since I want to move from Flash, I would like to use Javascript, Jquery and HTML5 to completely redo our website so it can be used on phones, tablets, etc.

I have built a calendar and can cycle through the months (i'd eventually like to get a year view), but I'm having issues with a couple of items I had built into the flash version. First of all, I want to be able to show each employees work schedule on the calendar. They all work rotating shifts of 5 on 4 off. In AS3 i've taken their rotation, paired it with a start date for that rotation and was able to indicate in the datagrid "WORKING" on their days of work. This enables them to pick leave on their correct working days. In Jquery, I'd like to color the calendar on the dates that they are scheduled to work. IS that possible?

Secondly, they pick 5 days of leave at a time. I'd like to display a token of some sort on the page that contains their name. They could then drag the token to a day that they would like to have off. Once they click submit, the selections are submitted to the MySQL database I have set up. How can I create these tokens based on the user's login name.

Sorry for the noob questions. I'm just trying to get my head around the nuances of Javascript and jQuery

Thanks for any help!!
willise is offline   Reply With Quote
Old 04-13-2012, 08:54 PM   PM User | #2
rnd me
Senior Coder

 
rnd me's Avatar
 
Join Date: Jun 2007
Location: Urbana
Posts: 3,462
Thanks: 9
Thanked 466 Times in 450 Posts
rnd me is a jewel in the roughrnd me is a jewel in the roughrnd me is a jewel in the rough
Quote:
Originally Posted by willise View Post
Since I want to move from Flash, I would like to use Javascript, Jquery and HTML5 to completely redo our website so it can be used on phones, tablets, etc.

I have built a calendar and can cycle through the months (i'd eventually like to get a year view), but I'm having issues with a couple of items I had built into the flash version. First of all, I want to be able to show each employees work schedule on the calendar. They all work rotating shifts of 5 on 4 off. In AS3 i've taken their rotation, paired it with a start date for that rotation and was able to indicate in the datagrid "WORKING" on their days of work. This enables them to pick leave on their correct working days. In Jquery, I'd like to color the calendar on the dates that they are scheduled to work. IS that possible?
there is not enough info here to make broad recommendations or discuss specific code implementations. Yes, you can color a calendar with js/jquery, but the devil is in the details.
the main thing here is connecting a date to a certain table cell. yes,, a table cell, not a calendar day. if you could alter the data going into whatever build your calendar, i would think that would be eaiser than trying to "bolt on" data to an existing view.
essentially, you massage the cal data to reflect one person, and draw the cal for that one person. so, you mod BEFORE you make the html calendar...


Quote:
Originally Posted by willise View Post
Secondly, they pick 5 days of leave at a time. I'd like to display a token of some sort on the page that contains their name. They could then drag the token to a day that they would like to have off. Once they click submit, the selections are submitted to the MySQL database I have set up. How can I create these tokens based on the user's login name.

dragging is nogood for mobile, and that sounds overly-complicated in general. If you know who is using the app why the complex interaction?

if you simply had a <form> around the cal, and each day had a checkbox like
Code:
<td class='day'>
  <b>14</b>
  <br />
  <label>
   <input type='checkbox' name='feb142012' /> Off
  </label>
</td>
, submitting the form would send a list of all requested days off for the logged-in user to php, which can them dump it to mysql.
__________________
my site (updated 5/13)
STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.6% IE9:9.8% IE10:10%

Last edited by rnd me; 04-13-2012 at 08:57 PM..
rnd me is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:58 AM.


Advertisement
Log in to turn off these ads.