src/jquery.gridster.js:90
Gridster
el
[options]
[options.autogenerate_stylesheet] If true, all the CSS required to position all widgets in their respective columns and rows will be generated automatically and injected to the `<head>` of the document. You can set this to false, and write your own CSS targeting rows and cols via data-attributes like so: `[data-col="1"]
[options.resize.axes] Axes in which widgets can be resized. Possible values: ['x', 'y', 'both']
[options.resize.max_size] Limit widget dimensions when resizing. Array values should be integers: `[max_cols_occupied, max_rows_occupied]
[options.resize.min_size] Limit widget dimensions when resizing. Array values should be integers: `[min_cols_occupied, min_rows_occupied]
Defined insrc/jquery.gridster.js:90
el
HTMLElementThe HTMLelement that contains all the widgets.
[options]
ObjectoptionalAn Object with all options you want to overwrite:
[widget_selector]
HTMLElement | StringoptionalDefine who will be the draggable widgets. Can be a CSS Selector String or a collection of HTMLElements
[widget_margins]
ArrayoptionalMargin between widgets. The first index for the horizontal margin (left, right) and the second for the vertical margin (top, bottom).
[widget_base_dimensions]
ArrayoptionalBase widget dimensions in pixels. The first index for the width and the second for the height.
[extra_cols]
NumberoptionalAdd more columns in addition to those that have been calculated.
[extra_rows]
NumberoptionalAdd more rows in addition to those that have been calculated.
[min_cols]
NumberoptionalThe minimum required columns.
[max_cols]
NumberoptionalThe maximum columns possible (set to null for no maximum).
[min_rows]
NumberoptionalThe minimum required rows.
[avoid_overlapped_widgets]
BooleanoptionalAvoid that widgets loaded from the DOM can be overlapped. It is helpful if the positions were bad stored in the database or if there was any conflict.
[auto_init]
BooleanoptionalAutomatically call gridster init method or not when the plugin is instantiated.
[serialize_params]
FunctionoptionalReturn the data you want for each widget in the serialization. Two arguments are passed:$w
: the jQuery wrapped HTMLElement, andwgd
: the grid coords object (col
,row
,size_x
,size_y
).
[shift_larger_widgets_down]
BooleanoptionalDetermines if how widgets get pushes out of the way of the player. If set to false smaller widgets will not move larger widgets out of their way . Defaults to true.
[shift_widgets_up]
BooleanoptionalDetermines if the player will automatically condense the grid and not allow a widget to have space above it. Defaults to true.
[show_element]
FunctionoptionalMakes the given element visible. Two arguments are passed:$el
: the jQuery wrapped HTMLElement, andcallback
: a function that is executed after the element is made visible. The callback parameter is optional.
[hide_element]
FunctionoptionalHides the given element. Two arguments are passed:$el
: the jQuery wrapped HTMLElement, andcallback
: a function that is executed after the element is hidden. The callback parameter is optional.
[collision]
ObjectoptionalAn Object with all options for Collision class you want to overwrite. See Collision docs for more info.
[wait_for_mouseup]
Booleanoptional[draggable]
ObjectoptionalAn Object with all options for Draggable class you want to overwrite. See Draggable docs for more info.
[ignore_dragging]
Object | Functionoptional[resize]
ObjectoptionalAn Object with resize config options.
[enabled]
Booleanoptional[handle_append_to]
Stringoptional[handle_class]
Stringoptional[start]
Functionoptional[resize]
Functionoptional[stop]
Functionoptional[options.autogenerate_stylesheet] If true, all the CSS required to position all widgets in their respective columns and rows will be generated automatically and injected to the `<head>` of the document. You can set this to false, and write your own CSS targeting rows and cols via data-attributes like so: `[data-col="1"]
Boolean{ left: 10px; }`
[options.resize.axes] Axes in which widgets can be resized. Possible values: ['x', 'y', 'both']
Array.
[options.resize.max_size] Limit widget dimensions when resizing. Array values should be integers: `[max_cols_occupied, max_rows_occupied]
Array`
[options.resize.min_size] Limit widget dimensions when resizing. Array values should be integers: `[min_cols_occupied, min_rows_occupied]
Array`
add_faux_cell
row
col
Defined insrc/jquery.gridster.js:3938
Add cell to the faux grid.
row
NumberThe row for the new faux cell.
col
NumberThe col for the new faux cell.
Returns the instance of the Gridster class.
add_faux_cols
cols
Defined insrc/jquery.gridster.js:3999
Add cols to the faux grid.
cols
NumberThe number of cols you want to add to the faux grid.
Returns the instance of the Gridster class.
add_faux_rows
rows
Defined insrc/jquery.gridster.js:3971
Add rows to the faux grid.
rows
NumberThe number of rows you want to add to the faux grid.
Returns the instance of the Gridster class.
add_resize_handle representing the widget.
$w
Defined insrc/jquery.gridster.js:534
Append the resize handle into a widget.
$w
ObjectReturns instance of gridster Class.
add_style_tag
css
Defined insrc/jquery.gridster.js:3859
Injects the given CSS as string to the head of the document.
css
StringThe styles to apply.
Returns the instance of the Gridster class.
add_to_gridmap
grid_data
[value]
Defined insrc/jquery.gridster.js:1299
Add a widget to the mapped array of positions.
grid_data
ObjectThe grid coords object representing the cells to update in the mapped array.
[value]
HTMLElement | BooleanoptionalThe value to set in the specified position .
Returns the instance of the Gridster Class.
add_widget
html
[size_x]
[size_y]
[col]
[row]
[max_size]
[min_size]
[callback]
Defined insrc/jquery.gridster.js:403
Add a new widget to the grid.
html
String | HTMLElementThe string representing the HTML of the widget or the HTMLElement.
[size_x]
NumberoptionalThe nº of rows the widget occupies horizontally.
[size_y]
NumberoptionalThe nº of columns the widget occupies vertically.
[col]
NumberoptionalThe column the widget should start in.
[row]
NumberoptionalThe row the widget should start in.
[max_size]
Arrayoptionalmax_size Maximun size (in units) for width and height.
[min_size]
Arrayoptionalmin_size Minimum size (in units) for width and height.
[callback]
FunctionoptionalFunction executed after the widget is shown.
Returns the jQuery wrapped HTMLElement representing. the widget that was just created.
can_go_player_up
widget_grid_data
Defined insrc/jquery.gridster.js:2608
Determines whether the player can move to a position above.
widget_grid_data
ObjectThe actual grid coords object of the player.
If the player can be moved to an upper row returns the row number, else returns false.
can_go_up_to_row
widget_grid_data
col
row
Defined insrc/jquery.gridster.js:3108
Check if the widget can move to the specified row, else returns theupper row possible.
widget_grid_data
NumberThe current grid coords object of the widget.
col
NumberThe target column.
row
NumberThe target row.
Returns the row number if the widget can move to the target position, else returns false.
can_go_widget_up
widget_grid_data
Defined insrc/jquery.gridster.js:2661
Determines whether a widget can move to a position above.
widget_grid_data
ObjectThe actual grid coords object of the widget we want to check.
If the widget can be moved to an upper row returns the row number, else returns false.
can_move_to
widget_grid_data
col
row
Defined insrc/jquery.gridster.js:3300
Check if it's possible to move a widget to a specific col/row. It takesinto account the dimensions (size_y
andsize_x
attrs. of the grid coords object) the widget occupies.
widget_grid_data
ObjectThe grid coords object that represents the widget.
col
ObjectThe col to check.
row
ObjectThe row to check.
Returns true if all cells are empty, else return false.
collapse_widget
$widget
[callback]
Defined insrc/jquery.gridster.js:651
Collapse the widget to it's pre-expanded size
$widget
HTMLElementThe jQuery wrapped HTMLElement representing the widget.
[callback]
FunctionoptionalFunction executed when the widget is collapsed.
Returns $widget.
destroy
remove
Defined insrc/jquery.gridster.js:4218
Destroy this gridster by removing any sign of its presence, making it easy to avoid memory leaks
remove
BooleanIf true, remove gridster from DOM.
Returns the instance of the Gridster class.
disable
Defined insrc/jquery.gridster.js:352
Disables dragging.
Returns the instance of the Gridster Class.
disable
Defined insrc/jquery.gridster.js:377
Disables drag-and-drop widget resizing.
Returns instance of gridster Class.
dom_to_coords
$widget
Defined insrc/jquery.gridster.js:1142
Convert widgets from DOM elements to "widget grid data" Objects.
$widget
HTMLElementThe widget to be converted.
draggable
Defined insrc/jquery.gridster.js:1314
Make widgets draggable.
Returns the instance of the Gridster Class.
empty_cells
col
row
size_x
size_y
[$exclude]
Defined insrc/jquery.gridster.js:912
Move down widgets in cells represented by the arguments col, row, size_x,size_y
col
NumberThe column where the group of cells begin.
row
NumberThe row where the group of cells begin.
size_x
NumberThe number of columns that the group of cellsoccupy.
size_y
NumberThe number of rows that the group of cellsoccupy.
[$exclude]
HTMLElementoptionalExclude widgets from being moved.
Returns the instance of the Gridster Class.
empty_cells_player_occupies
Defined insrc/jquery.gridster.js:3246
Remove from the array of mapped positions the reference to the player.
Returns the instance of the Gridster Class.
enable
Defined insrc/jquery.gridster.js:365
Enables dragging.
Returns the instance of the Gridster Class.
enable
Defined insrc/jquery.gridster.js:390
Enables drag-and-drop widget resizing.
Returns instance of gridster Class.
expand_widget
$widget
size_x
size_y
col
[callback]
Defined insrc/jquery.gridster.js:604
Expand the widget. Width is set to the current grid width.
$widget
HTMLElementThe jQuery wrapped HTMLElement representing the widget.
size_x
NumberThe number of cols that will occupy the widget.
size_y
NumberThe number of rows that will occupy the widget.
col
NumberThe column to resize the widget from.
[callback]
FunctionoptionalFunction executed when the widget is expanded.
Returns $widget.
fit_to_content
$widget
max_cols
max_rows
[callback]
Defined insrc/jquery.gridster.js:686
Fit the size of a widget to its content (best guess)
$widget
HTMLElement$widget The jQuery wrapped HTMLElement
max_cols
Numbermax number of columns a widget can take up
max_rows
Numbermax number of rows a widget can take up
[callback]
FunctionoptionalFunction executed when the widget is fit to content.
Returns $widget.
for_each_cell_occupied widget.
grid_data
callback
Defined insrc/jquery.gridster.js:3409
Iterate over the cells occupied by a widget executing a function foreach one.
grid_data
Objectcallback
FunctionThe function to execute on each column iteration. Column and row are passed as arguments.
Returns the instance of the Gridster Class.
for_each_column_occupied
el_grid_data
callback
Defined insrc/jquery.gridster.js:3430
Iterate over the columns occupied by a widget executing a function foreach one.
el_grid_data
ObjectThe grid coords object that represents the widget.
callback
FunctionThe function to execute on each column iteration. The column number is passed as first argument.
Returns the instance of the Gridster Class.
for_each_row_occupied
el_grid_data
callback
Defined insrc/jquery.gridster.js:3449
Iterate over the rows occupied by a widget executing a function foreach one.
el_grid_data
ObjectThe grid coords object that represents the widget.
callback
FunctionThe function to execute on each column iteration. The row number is passed as first argument.
Returns the instance of the Gridster Class.
for_each_widget_above
col
row
callback
Defined insrc/jquery.gridster.js:3540
Iterate over each widget above the column and row specified.
col
NumberThe column to start iterating.
row
NumberThe row to start iterating.
callback
FunctionThe function to execute on each widget iteration. The value ofthis
inside the function is the jQuery wrapped HTMLElement.
Returns the instance of the Gridster Class.
for_each_widget_below
col
row
callback
Defined insrc/jquery.gridster.js:3557
Iterate over each widget below the column and row specified.
col
NumberThe column to start iterating.
row
NumberThe row to start iterating.
callback
FunctionThe function to execute on each widget iteration. The value ofthis
inside the function is the jQuery wrapped HTMLElement.
Returns the instance of the Gridster Class.
generate_faux_grid
rows
cols
Defined insrc/jquery.gridster.js:3914
Generates a faux grid to collide with it when a widget is dragged anddetect row or column that we want to go.
rows
NumberNumber of columns.
cols
NumberNumber of rows.
Returns the instance of the Gridster class.
generate_grid_and_stylesheet
Defined insrc/jquery.gridster.js:4187
Calculate columns and rows to be set based on the configuration parameters, grid dimensions, etc ...
Returns the instance of the Gridster class.
generate_stylesheet
[opts]
Defined insrc/jquery.gridster.js:3792
It generates the necessary styles to position the widgets.
[opts]
ObjectoptionalReturns the instance of the Gridster class.
get_cells_occupied
el_grid_data
Defined insrc/jquery.gridster.js:3381
Get all columns and rows that a widget occupies.
el_grid_data
ObjectThe grid coords object of the widget.
Returns an object like{ cols: [], rows: []}
.
get_highest_occupied_cell
Defined insrc/jquery.gridster.js:3574
Returns the highest occupied cell in the grid.
Returns an object withcol
androw
numbers.
get_targeted_columns
[from_col]
Defined insrc/jquery.gridster.js:3345
Given the leftmost column returns all columns that are overlapping with the player.
[from_col]
NumberoptionalThe leftmost column.
Returns an array with column numbers.
get_targeted_rows
[from_row]
Defined insrc/jquery.gridster.js:3364
Given the upper row returns all rows that are overlapping with the player.
[from_row]
NumberoptionalThe upper row.
Returns an array with row numbers.
get_valid_rows
widget_grid_data
upper_rows
min_row
Defined insrc/jquery.gridster.js:2718
Search a valid row for the widget represented bywidget_grid_data' inthe
upper_rowsarray. Iteration starts from row specified in
min_row`.
widget_grid_data
ObjectThe actual grid coords object of the player.
upper_rows
ArrayAn array with columns as index and arrays of valid rows as values.
min_row
NumberThe upper row from which the iteration will start.
Returns the upper row valid from theupper_rows
for the widget in question.
get_widgets_from_DOM
Defined insrc/jquery.gridster.js:4097
Get all widgets in the DOM and register them.
Returns the instance of the Gridster class.
get_widgets_overlapped
Defined insrc/jquery.gridster.js:2796
Get widgets overlapping with the player.
Returns a jQuery collection of HTMLElements.
get_widgets_under_player
Defined insrc/jquery.gridster.js:2513
Get widgets overlapping with the player or with the object passedrepresenting the grid cells.
Returns a jQuery collection of HTMLElements
is_empty
col
row
Defined insrc/jquery.gridster.js:2349
Determines if the cell represented by col and row params is empty.
col
NumberThe column to check.
row
NumberThe row to check.
Returns true or false.
is_occupied
col
row
Defined insrc/jquery.gridster.js:2414
Determines if the cell represented by col and row params is occupied.
col
NumberThe column to check.
row
NumberThe row to check.
Returns true or false.
is_placeholder_in
col
row
Defined insrc/jquery.gridster.js:2322
Determines if the placeholder is currently over the row and col given.
col
NumberThe column to check.
row
NumberThe row to check.
Returns true or false.
is_placeholder_in_col
col
Defined insrc/jquery.gridster.js:2336
Determines if the placeholder is currently over the column given.
col
NumberThe column to check.
Returns true or false.
is_player
col_or_el
[row]
Defined insrc/jquery.gridster.js:2288
Determines if there is a widget in the row and col given. Or if theHTMLElement passed as first argument is the player.
col_or_el
Number | HTMLElementA jQuery wrapped collection ofHTMLElements.
[row]
NumberoptionalThe column to which we want to move the widgets.
Returns true or false.
is_player_in
col
row
Defined insrc/jquery.gridster.js:2307
Determines if the widget that is being dragged is currently over the rowand col given.
col
NumberThe column to check.
row
NumberThe row to check.
Returns true or false.
is_static
col
row
Defined insrc/jquery.gridster.js:2466
Determines if widget is supposed to be static.WARNING: as of 0.6.6 this feature is buggy whenused with resizable widgets, as resizing widgetsabove and below a static widgit can cause it to move.This feature is considered experimental at this time
col
NumberThe column to check.
row
NumberThe row to check.
Returns true if widget exists and has static class,else returns false
is_widget
col
row
Defined insrc/jquery.gridster.js:2442
Determines if there is a widget in the cell represented by col/row params.
col
NumberThe column to check.
row
NumberThe row to check.
Returns false if there is no widget,else returns the jQuery HTMLElement
is_widget_under_player
col
row
Defined insrc/jquery.gridster.js:2496
Determines if there is a widget in the cell represented by col/rowparams and if this is under the widget that is being dragged.
col
NumberThe column to check.
row
NumberThe row to check.
Returns true or false.
manage_movements
$widgets
to_col
to_row
Defined insrc/jquery.gridster.js:2239
Sorts an Array of grid coords objects (representing the grid coords ofeach widget) in descending way.
Depreciated.
$widgets
JQueryA jQuery collection of HTMLElements representing the widgets you want to move.
to_col
NumberThe column to which we want to move the widgets.
to_row
NumberThe row to which we want to move the widgets.
Returns the instance of the Gridster Class.
move_widget
$widget
new_col
new_row
callback
Defined insrc/jquery.gridster.js:2912
Move a widget to a specific row and column.If the widget has widgets below, all of these widgets will be moved also
$widget
HTMLElementThe jQuery wrapped HTMLElement of thewidget is going to be moved.
new_col
Numberthe column number to be set in widget
new_row
Numberthe row number to be set in widget
callback
Functionis called when whole process is done.
Returns the instance of the Gridster Class.
move_widget_down
$widget
y_units
Defined insrc/jquery.gridster.js:3041
Move down the specified widget and all below it.
$widget
JQueryThe jQuery object representing the widget you want to move.
y_units
NumberThe number of cells that the widget has to move.
Returns the instance of the Gridster Class.
move_widget_to
$widget
row
Defined insrc/jquery.gridster.js:2947
Move a widget to a specific row. The cell or cells must be empty.If the widget has widgets below, all of these widgets will be moved alsoif they can.
$widget
HTMLElementThe jQuery wrapped HTMLElement of thewidget is going to be moved.
row
ObjectReturns the instance of the Gridster Class.
move_widget_up
$widget
[y_units]
Defined insrc/jquery.gridster.js:2990
Move up the specified widget and all below it.
$widget
HTMLElementThe widget you want to move.
[y_units]
NumberoptionalThe number of cells that the widget has to move.
Returns if the widget moved
mutate_widget_in_gridmap
$widget
wgd
new_wgd
Defined insrc/jquery.gridster.js:812
Mutate widget dimensions and position in the grid map.
$widget
HTMLElementThe jQuery wrapped HTMLElement representing the widget to mutate.
wgd
ObjectCurrent widget grid data (col, row, size_x, size_y).
new_wgd
ObjectNew widget grid data.
Returns instance of gridster Class.
next_position
size_x
size_y
Defined insrc/jquery.gridster.js:986
Get the most left column below to add a new widget.
size_x
NumberThe nº of rows the widget occupies horizontally.
size_y
NumberThe nº of columns the widget occupies vertically.
Returns a grid coords object representing the future widget coords.
on_drag
event
ui
Defined insrc/jquery.gridster.js:1468
This function is executed when the player is being dragged.
event
EventThe original browser event
ui
ObjectA prepared ui object with useful drag-related data
on_overlapped_column_change
start_callback
stop_callback
Defined insrc/jquery.gridster.js:1820
Executes the callbacks passed as arguments when a column begins to beoverlapped or stops being overlapped.
start_callback
FunctionFunction executed when a new column begins to be overlapped. The column is passed as first argument.
stop_callback
FunctionFunction executed when a column stops being overlapped. The column is passed as first argument.
Returns the instance of the Gridster Class.
on_overlapped_row_change
start_callback
end_callback
Defined insrc/jquery.gridster.js:1860
Executes the callbacks passed as arguments when a row starts to beoverlapped or stops being overlapped.
start_callback
FunctionFunction executed when a new row begins to be overlapped. The row is passed as first argument.
end_callback
FunctionFunction executed when a row stops being overlapped. The row is passed as first argument.
Returns the instance of the Gridster Class.
on_resize
event
ui
Defined insrc/jquery.gridster.js:1726
This function is executed when a widget is being resized.
event
EventThe original browser event
ui
ObjectA prepared ui object with useful drag-related data
on_start_drag
event
ui
Defined insrc/jquery.gridster.js:1410
This function is executed when the player begins to be dragged.
event
EventThe original browser event
ui
ObjectA prepared ui object with useful drag-related data
on_start_overlapping_column
col
Defined insrc/jquery.gridster.js:2829
This callback is executed when the player begins to collide with a column.
col
NumberThe collided column.
Returns a jQuery collection of HTMLElements.
on_start_overlapping_row
row
Defined insrc/jquery.gridster.js:2841
A callback executed when the player begins to collide with a row.
row
NumberThe collided row.
Returns a jQuery collection of HTMLElements.
on_start_resize
event
ui
Defined insrc/jquery.gridster.js:1622
This function is executed every time a widget starts to be resized.
event
EventThe original browser event
ui
ObjectA prepared ui object with useful drag-related data
on_stop_drag
event
ui
Defined insrc/jquery.gridster.js:1525
This function is executed when the player stops being dragged.
event
EventThe original browser event
ui
ObjectA prepared ui object with useful drag-related data
on_stop_overlapping_column
col
Defined insrc/jquery.gridster.js:2853
A callback executed when the the player ends to collide with a column.
col
NumberThe collided row.
Returns a jQuery collection of HTMLElements.
on_stop_overlapping_row
row
Defined insrc/jquery.gridster.js:2872
This callback is executed when the player ends to collide with a row.
row
NumberThe collided row.
Returns a jQuery collection of HTMLElements.
on_stop_resize
event
ui
Defined insrc/jquery.gridster.js:1685
This function is executed every time a widget stops being resized.
event
EventThe original browser event
ui
ObjectA prepared ui object with useful drag-related data
recalculate_faux_grid
Defined insrc/jquery.gridster.js:4029
Recalculates the offsets for the faux grid. You need to use it whenthe browser is resized.
Returns the instance of the Gridster class.
register_widget
$el
Defined insrc/jquery.gridster.js:1162
Creates the grid coords object representing the widget an add it to themapped array of positions.
$el
HTMLElement | ObjectjQuery wrapped HTMLElement representing the widget, or an "widget grid data" Object with (col, row, el ...).
Returns true if the widget final position is different than the original.
remove_all_widgets
callback
Defined insrc/jquery.gridster.js:1091
Remove all widgets from the grid.
callback
FunctionFunction executed for each widget removed.
Returns the instance of the Gridster Class.
remove_empty_cells
col
row
size_x
size_y
exclude
Defined insrc/jquery.gridster.js:954
Move up widgets below cells represented by the arguments col, row, size_x,size_y.
col
NumberThe column where the group of cells begin.
row
NumberThe row where the group of cells begin.
size_x
NumberThe number of columns that the group of cellsoccupy.
size_y
NumberThe number of rows that the group of cellsoccupy.
exclude
HTMLElementExclude widgets from being moved.
Returns the instance of the Gridster Class.
remove_from_gridmap
grid_data
Defined insrc/jquery.gridster.js:1286
Remove a widget from the mapped array of positions.
grid_data
ObjectThe grid coords object representing the cells to update in the mapped array.
Returns the instance of the Gridster Class.
remove_style_tag
Defined insrc/jquery.gridster.js:3894
Remove the style tag with the associated id from the head of the document
Returns the instance of the Gridster class.
remove_widget
el
[silent]
[callback]
Defined insrc/jquery.gridster.js:1036
Remove a widget from the grid.
el
HTMLElementThe jQuery wrapped HTMLElement you want to remove.
[silent]
Boolean | FunctionoptionalIf true, widgets below the removed onewill not move up. If a Function is passed it will be used as callback.
[callback]
FunctionoptionalFunction executed after the widget is removed.
Returns the instance of the Gridster Class.
resizable
Defined insrc/jquery.gridster.js:1356
Bind resize events to get resize working.
Returns instance of gridster Class.
resize_widget
$widget
[size_x]
[size_y]
[callback]
Defined insrc/jquery.gridster.js:553
Change the size of a widget. Width is limited to the current grid width.
$widget
HTMLElementThe jQuery wrapped HTMLElement representing the widget.
[size_x]
NumberoptionalThe number of columns that will occupy the widget. By defaultsize_x
is limited to the space available from the column where the widget begins, until the last column to the right.
[size_y]
NumberoptionalThe number of rows that will occupy the widget.
[callback]
FunctionoptionalFunction executed when the widget is removed.
Returns $widget.
resize_widget_dimensions
options
Defined insrc/jquery.gridster.js:4064
Resize dimensions of widgets in grid based on given options
options
Objectserialize
[$widgets]
Defined insrc/jquery.gridster.js:1107
Returns a serialized array of the widgets in the grid.
[$widgets]
HTMLElementoptionalThe collection of jQuery wrapped HTMLElements you want to serialize. If no argument is passed all widgets will be serialized.
Returns an Array of Objects with the data specified in the serialize_params option.
serialize_changed
Defined insrc/jquery.gridster.js:1129
Returns a serialized array of the widgets that have changed their position.
Returns an Array of Objects with the data specified in the serialize_params option.
set_cells_player_occupies
col
col
row
Defined insrc/jquery.gridster.js:3228
Update the array of mapped positions with the new player position.
col
NumberThe new player col.
col
NumberThe new player row.
row
ObjectReturns the instance of the Gridster Class.
set_dom_grid_height
Defined insrc/jquery.gridster.js:3678
Set the current height of the parent grid.
Returns the instance of the Gridster class.
set_dom_grid_width
Defined insrc/jquery.gridster.js:3695
Set the current width of the parent grid.
Returns the instance of the Gridster class.
set_placeholder
col
row
Defined insrc/jquery.gridster.js:2536
Put placeholder at the row and column specified.
col
NumberThe column to which we want to move the placeholder.
row
NumberThe row to which we want to move the placeholder.
Returns the instance of the Gridster Class.
set_player
col
row
no_player
Defined insrc/jquery.gridster.js:1896
Sets the current position of the player
col
Numberrow
Numberno_player
Booleanset_widget_max_size
$widget
max_size
Defined insrc/jquery.gridster.js:509
Change widget size limits.
$widget
HTMLElement | NumberThe jQuery wrapped HTMLElement representing the widget or an index representing the desired widget.
max_size
ArrayMaximun size (in units) for width and height.
Returns instance of gridster Class.
set_widget_min_size
$widget
min_size
Defined insrc/jquery.gridster.js:484
Change widget size limits.
$widget
HTMLElement | NumberThe jQuery wrapped HTMLElement representing the widget or an index representing the desired widget.
min_size
ArrayMinimum size (in grid units) for width and height.
Returns instance of gridster Class.
setup_resize
Defined insrc/jquery.gridster.js:1384
Setup things required for resizing. Like build templates for drag handles.
Returns instance of gridster Class.
sort_by_col_asc
widgets
Defined insrc/jquery.gridster.js:284
Sorts an Array of grid coords objects by column (representing the gridcoords of each widget) in ascending way.
widgets
ArrayArray of grid coords objects
Returns the array sorted.
sort_by_row_and_col_asc
widgets
Defined insrc/jquery.gridster.js:262
Sorts an Array of grid coords objects (representing the grid coords ofeach widget) placing first the empty cells upper left.
widgets
ArrayArray of grid coords objects
Returns the array sorted.
sort_by_row_asc
widgets
Defined insrc/jquery.gridster.js:235
Sorts an Array of grid coords objects (representing the grid coords ofeach widget) in ascending way.
widgets
ArrayArray of grid coords objects
Returns the array sorted.
sort_by_row_desc
widgets
Defined insrc/jquery.gridster.js:306
Sorts an Array of grid coords objects (representing the grid coords ofeach widget) in descending way.
widgets
ArrayArray of grid coords objects
Returns the array sorted.
update_widget_dimensions
$widget
wgd
Defined insrc/jquery.gridster.js:1236
Update the width and height for a widgets coordinate data.
$widget
HTMLElementThe widget to update.
wgd
Objectwgd Current widget grid data (col, row, size_x, size_y).
Returns the instance of the Gridster Class.
update_widget_position
grid_data
value
Defined insrc/jquery.gridster.js:1213
Update in the mapped array of positions the value of cells represented bythe grid coords object passed in thegrid_data
param.
grid_data
ObjectThe grid coords object representing the cells to update in the mapped array.
value
HTMLElement | BooleanPassfalse
or the jQuery wrapped HTMLElement, depends if you want to delete an existing position or add a new one.
Returns the instance of the Gridster Class.
update_widgets_dimensions
Defined insrc/jquery.gridster.js:1268
Update dimensions for all widgets in the grid.
Returns the instance of the Gridster Class.
widgets_below
$el
Defined insrc/jquery.gridster.js:3198
Get widgets below a widget.
$el
ObjectThe jQuery wrapped HTMLElement.
A jQuery collection of HTMLElements.
widgets_contraints
$widgets
Defined insrc/jquery.gridster.js:2203
See which of the widgets in the $widgets param collection can go toa upper row and which not.
$widgets
JQueryA jQuery wrapped collection ofHTMLElements.
Returns a literal Object with two keys:can_go_up
&can_not_go_up
. Each contains a set of HTMLElements.