Giter Club home page Giter Club logo

resource-view's Introduction

-- Resource View --
Author: Will Gaggioli
Use as you see fit

To initialize:

$(container_object).resourceView({
    option1: value,
    ...
});

To use methods:

$(container_object).data('resourceView').method(...);

Options:

*  resources       array of objects with name and id attributes
*  resource_label  label to put in the table head above the resources
*                  (default Resources)
*  events          array of objects with the following attributes:
*                      * resource_id
*                      * date_start
*                      * date_end
*                      * display (optional): html to display for event
*                      * top (optional): boolean, may not use this
*  events_url      url to which to make an ajax request to collect events
*                  array, which must be accessable via 'events' property
*                  of the response
*  render_event	function to call that returns the html al dentro de
*  				un event (default will look for display html)
*  cell_content	function to call that returns the contents of a cell
*  date_start      start date to use for calendar
*  days            number of days displayed at a time
*  fetch_data		data to include in ajax request to fetch events. If
*  				a callable, is called to obtain the data.
*  left_nav		html content of left nav button
*  right_nav		html content of right nav button
*  double_left_nav 	content of double left nav
*  double_right_nav	content of double right nav
*  date_picker		html content of date picker buttons
*  selectable		mimics jquery ui's selectable behavior for cells
*  resizable		allows extension along left, right (requires
*  				jquery-ui resizable)
*  draggable		allows drag and drop of events
*  event_click		function triggered on event click
*  cell_select		function triggered on cell select
*  cell_deselect   function triggered on cell deselect
*  on_resize		function triggered on event resize
*  resize_start	function triggered on start of resize
*  on_drag			function triggered when cell is dragged
*  drag_start		function triggered on start of drag
*  on_over			function triggered on mouse over
*  on_out			function triggered on mouse out

Methods:

fetchEvents() -- fetches events from the server and rerenders
getDateAtIndex(i) -- gets date at index i
clearCache -- clears the position cache, do this if manually resizing
render -- initial render

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.