Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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!!

  • #2
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,302
    Thanks
    10
    Thanked 586 Times in 567 Posts
    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.
    Last edited by rnd me; 04-13-2012 at 08:57 PM.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/5/28) IE7:0.1, IE8:5.3, IE11:8.4, IE9:3.2, IE10:3.2, FF:18.2, CH:46, SF:7.9, NON-MOUSE:32%


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •