Giter Club home page Giter Club logo

jquery.schedule's Introduction

jq.Schedule

npm version Build Status License: MIT

jquery and html schedule calendar

  • Drag and Drop Support
  • Resize Schedule
  • Ajax Get Data

install

package

npm i jq.schedule --save

Demo

Try Demo

How to use

append head css

<link rel="stylesheet" type="text/css" href="./jquery.schedule/dist/css/style.min.css" />

insert body

<div id="schedule"></div>
<script type="text/javascript" src="./jquery.schedule/dist/js/jq.schedule.min.js"></script>
<script type="text/javascript">
    $(function(){
        var $sc = $("#schedule").timeSchedule({
            startTime: "07:00", // schedule start time(HH:ii)
            endTime: "21:00",   // schedule end time(HH:ii)
            widthTime:60 * 10,  // cell timestamp example 10 minutes
            timeLineY:60,       // height(px)
            verticalScrollbar:20,   // scrollbar (px)
            timeLineBorder:2,   // border(top and bottom)
            bundleMoveWidth:6,  // width to move all schedules to the right of the clicked time line cell
            rows : {
                '0' : {
                    title : 'Title Area',
                    subtitle : 'Description',
                    schedule:[
                        {
                            start:'09:00',
                            end:'12:00',
                            text:'Text Area',
                            data:{
                            }
                        },
                        {
                            start:'11:00',
                            end:'14:00',
                            text:'Text Area',
                            data:{
                            }
                        }
                    ]
                },
                '1' : {
                    title : 'Title Area',
                    schedule:[
                        {
                            start:'16:00',
                            end:'17:00',
                            text:'Text Area',
                            data:{
                            }
                        }
                    ]
                }
            },
            onChange: function(node, data){
                addLog('onChange', data);
            },
            onInitRow: function(node, data){
                addLog('onInitRow', data);
            },
            onClick: function(node, data){
                addLog('onClick', data);
            },
            onAppendRow: function(node, data){
                addLog('onAppendRow', data);
            },
            onAppendSchedule: function(node, data){
                addLog('onAppendSchedule', data);
            },
            onScheduleClick: function(node, time, timeline){
                addLog('onScheduleClick', time + ' ' + timeline);
            }
        });
    });
</script>

Options

Paramaters

Key Value Description
className jq-schedule add elemnt class(default jq.schedule)
startTime 07:00 schedule start time(HH:ii)
endTime 21:00 schedule end time(HH:ii)
widthTime 600 cell timestamp example 10 minutes
timeLineY 60 height(px)
verticalScrollbar 20 scrollbar (px)
timeLineBorder 2 border(top and bottom)
bundleMoveWidth 6 width to move all schedules to the right of the clicked time line cell
rows {object} schedule data
draggable {boolean} enable draggable(default true)
resizable {boolean} enable resizable(default true)
resizableLeft {boolean} enable left handle resizable(default false)

Schedule Data

Key Type Description
title string Schedule Row Title
subtitle string Schedule Row Description
schedule object[] schedule row of array

Schedule Data in Object

Key Type Description
start string HH:ii
end string HH:ii
text string Bar Title
data object bind data

Callback Methods

onChange(node: Element, data: Object)

on change schedule bar callback

onInitRow(node: Element, data: Object)

initialize data

onClick(node: Element, data: Object)

on click bar callback

onAppendRow(node: Element, data: Object)

on add schedule row callback

onSppendSchedule(node: Element, data: Object)

on add schedule bar callback

onScheduleClick(node: Element, time: string, data: Object)

on click schedule row callback

Methods

get row data

var data = $("#schedule").timeSchedule('timelineData');

get schedule data

var data = $("#schedule").timeSchedule('scheduleData');

clear all data

$("#schedule").timeSchedule('resetData');

clear all data and row

$("#schedule").timeSchedule('resetRowData');

add row

$("#schedule").timeSchedule('addRow', timeline, {
    title : 'Title Area',
    schedule:[
        {
            start:'09:00',
            end:'12:00',
            text:'Text Area',
            data:{
            }
        }
    ]
});

add data

$("#schedule").timeSchedule('addSchedule', timeline, {
    start: start,
    end: end,
    text:'Insert Schedule',
    data:{}
});

switch setting

$("#schedule").timeSchedule('setDraggable', true or false);
$("#schedule").timeSchedule('setResizable', true or false);

For Development

run server browser-sync

npm run serve

jquery.schedule's People

Contributors

ateliee avatar dependabot[bot] avatar edg2s avatar geoah avatar takoshi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jquery.schedule's Issues

Only move on y-axis

Is it possible to move a schedule only on the y-axis? So draggable, but hours stay the same

bootstrap4

hi
thanks for project
but the project is not good working in bootstrap 4 modal dialog
also no good working in direction RTL
thanks

Unable to make Ajax1() , Ajax2() and Ajax3() buttons work locally and paint the task boxes in other colors.

Good afternoon,

I have downloaded in a zip the repository and when I test it locally, I open the demo folder and the index.html.

I click on the Ajax1() , Ajax2() and Ajax() buttons and it does nothing, it always paints the same graphic.

However, in the online demo that you have, these buttons work perfectly, the graphic changes and the task boxes are painted in other colors and even with images.

What should I do to make these buttons work locally and have the boxes painted in other colors?
Is the version that is online the same as the Master branch of the repository?

Thanks in advance,

Best regards.

Disable Overlapping Items

Hi there, just wondering if it is possible to disable the overlapping of items within the schedule? Its not something my app supports.

Thanks.

Overlap schedule items

Hi all

Thank you for this great work!
In our case, we have i.e. 5 events. each of them starts different. But all of them have the same end time. So they are all the "same" schedule (event). We want now that they will be overlap, so all on same line. One over the other. Is this possible to configure?

Thank you for your help

Add remove scheduled item method

Hello,

I'd like not only to add items, but also to remove them (and then informing the server about the this)

Currently, the workaround I will use is to delete the item from a modal window, send the update to the server and then re-draw the whole calendar.
But it would be more efficient to send a simple delete item command to a server

Thank you!

Stop Scrolling

When load schedule from ajax automatically scrolling top of page.
I tried e.PreventDefault() , $('html').stop and other methods but still scolling top of page.I think that in jq.schedule.js file addRow method do that.
Or how can i stop scroliing page?
Thanks

Timeline indexes missmatch.

Currently the timelineData array holds the timelines using the index that was provided in the initialization object.

{
        rows : {
            '1': {},
            '2': {}
        }
}

But the scheduleData object references the timeline as an internal index. For example a schedule for the timeline in row with key 1 would be set as 0 in scheduleData.timeline. It would be useful and more safe to use the row's key instead of an index.

Mouse Over implementation

It would be interesting to be able to put the mouse over the boxes and have it show a kind of popup with information related to the task.

How could Mouse Over be implemented ?

Reverse Row and Col

Hi;
I was wondering if it's possible to switch row and col. Meaning but the time on the side and the room on the top.

Thanks

RowGroup

Hi Ateliee,
I have a issue:
I have a Deparment with employees A, B & C.
So, I want group Department for Row A, B & C like rowspan.
How can i display it?

For example:


                A      sc_bar
Department      B      sc_bar
                C      sc_bar

Thanks you for reading,
Have a nice day!

Performance problem

Hello,

When I have more than 100 timelines, it takes time to draw the bars.
Could you provide paging options?

Thank you

API Examples?

Thank you for this very useful and attractive control.

I retrieve data from a RESTful API, and I would like to use that data to create and update the schedule.

Are there examples of dynamically setting the text and time values for title and sc_Bar using javascript?

Again, thank you very much!

Vertical schedule

Hello, congratulations on the good work!
My question is whether it is possible for the program to be vertical - the rooms to be on top and the hours on the left?
Thanks.

Issues with overflow:auto

First of all thank you for your plugin it is feature-packed and very easy to use.
However due to requirements of our software I needed to extend the functionality of your plugin, but I'm encountering two issues:

1- To allow navigation inside the grid for a big grid (24 hours, several schedules), using the sc_main_box div as:

sc_main_box {
float: left;
overflow-x: auto;
overflow-y: auto;
position: relative;

However when dragging items they work fine unless the scroll doesn't move, otherwise they tend to become unrelated to the mouse cursor position. Is there a way to fix this?
Picture1

2- When two overlapping items are placed they correctly make the row bigger, but at the start of the row there is a blank space which is not a div, not a span, nothing at all. Can this be a consequence of having a 25h day (to allow post-midnight bookings?)
Picture2
aaaaa2
aaaaa1

Thank you for your time

Adding data-attributes to events/ schedules

Hey,

I have a project where I want to add additional information (e. x. ids), that can be read by JS, to my events (cells) and schedules (rows). Browsing through the documentation, I noticed the data property right here:

start:'09:00',
end:'12:00',
text:'Text Area',
data:{}

Initially I thought if I put key-value pairs into data, it would add them as data-attributes to my events, but it doesn't. Is there a way to do this with jquery.schedule?

Problem with the time grid

First thank you for sharing this unique script.

I have some problems with the timetables:

  1. When I define the total range from 00:00 to 23:59 the last time slot (23:50 to 23:59) is not displayed in the grid. It stops at 23:50). I tried to set the range from 00:00 to 00:00 but the grid no longer appears.

  2. Then, when I try to move a schedule until 23:50 this not work, I cannot move to this last time slot. If I try to resize it works but the schedule displayed is not updated, it always stays at 23:40.

To reproduce this error, you just need to test the demo by changing the global time range from 00:00 to 23:59.

Another suggestion: it would be useful to be able to set a real time slot, for example from 08:00 to 04:00.

Mobile / Touch

Hi
Cool plugin, exactly what i am searching for. But: Am I doing something wrong or is it not working on mobile- / touch-enabled-devices?

Chris

Setting Date

Hi..
This script is very beautiful, but I need this for date and not for hours..
This is possible?

Read Only Mode

Is it possible to make it read only, so that by users can move event?

Clear schedules

Hi.

I'm trying to clear the schedules to pu another per day.

How can i clear schedules

Multi Schedule & Resize Out Range

Hi Ateliee,
Thank you for your plugin.

I have 2 problem:

  1. I have proble with multi Schedule.
    I have #schedule1, #schedule2 with the same config.
    When I drag sc_bar to change of #schedule2, It disappear.
    This is my config:
$("#schedule1").timeSchedule({
		startTime: "07:00",
		endTime: "21:00",
		widthTime: 60 * 10,
		timeLineY: 60,
		verticalScrollbar: 20,
		timeLineBorder: 2,
		bundleMoveWidth: 6,
		draggable: true,
		resizable: true,
		rows: {
			'0': {
				title: 'Title Area1',
				schedule: [
					{
						start: '09:00',
						end: '12:00',
						text: 'Text Area',
						data: {
						}
					},
					{
						start: '11:00',
						end: '14:00',
						text: 'Text Area',
						data: {
						}
					}
				]
			},
			'1': {
				title: 'Title Area2',
				schedule: [
					{
						start: '16:00',
						end: '17:00',
						text: 'Text Area',
						data: {
						}
					}
				]
			}
		}
	});
  1. When I resize out range of start and end, It is not limited in range..
    What should I do?

Thanks you for reading,
Have a nice day!

Wrong timeline value when 2 items stacked in same timeline

You can check this problem on the demo too.

If you click (without draggin), the second item (stacked) on the first timeline. The return from the on Click is:

{"start":"11:00","end":"14:00","text":"Text Area","timeline":"1","data":{},"startTime":39600,"endTime":50400}

note that timeline value is 1, should be 0. Same happens when you resize the element.

If you move the element, timeline is recalculated and it works. I think on the initial load of data, something is wrong.

Get data from ajax and bind to schedule dynamically

Hello,

Thank you for your excellent works.

I have a schedule like this
var $sc = $("#schedule").timeSchedule({
startTime: "08:00", // schedule start time(HH:ii)
endTime: "21:00", // schedule end time(HH:ii)
widthTime: 60 * 10, // cell timestamp example 10 minutes
timeLineY: 32, // height(px)
verticalScrollbar: 20, // scrollbar (px)
timeLineBorder: 2, // border(top and bottom)
bundleMoveWidth: 6, // width to move all schedules to the right of the clicked time line cell
rows: {}
});
I have a service that will return the schedule of people (Title Area in your example).
I want to bind the data to your schedule control from ajax call. What should I do?
$.ajax({
type: "POST",
url: ProjectProperties.ajaxUrlPrefix + "/JeopardyService.svc/GetSchedules",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: JSON.stringify({ jobId: jobId }),
contentType: 'application/json; charset=utf-8',
success: function (result) {
if (result && result.schedules) {
???????????????????????????
//What should I do here?
}
}
});

Furthermore, the json format of the rows is a little bit strange for me also.

{
'0' : {
title : 'Title Area',
schedule:[
{
start:'09:00',
end:'12:00',
text:'Text Area',
data:{
}
},
{
start:'11:00',
end:'14:00',
text:'Text Area',
data:{
}
}
]
},
'1' : {
title : 'Title Area',
schedule:[
{
start:'16:00',
end:'17:00',
text:'Text Area',
data:{
}
}
]
}
}

How could you generate it by WCF in ASP.NET. How you create class and serialize the data on server?

Thank you very much

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.