🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

backgrid-columnmanager

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backgrid-columnmanager - npm Package Compare versions

Comparing version

to
0.2.1

bower.json

2

package.json
{
"name": "backgrid-columnmanager",
"version": "0.2.0",
"version": "0.2.1",
"description": "A backgrid column manager. Adds the ability to show/hide columns.",

@@ -5,0 +5,0 @@ "main": "lib/Backgrid.ColumnManager.js",

# Backgrid.ColumnManager
Manages the backgrid column collection. Adds the ability to toggle column visibility (initially and on the fly).
Manages the backgrid column collection. Adds the ability to toggle column visibility (initially and on the fly) and is able to track, save and load state (width, order and visibility).
[Online demo](https://wridder.github.io/backgrid-demo/)

@@ -14,3 +14,7 @@

var colManager = new Backgrid.Extension.ColumnManager(columns, {
initialColumnsVisible: 4
initialColumnsVisible: 4,
// State settings
saveState: true,
loadStateOnInit: true
});

@@ -33,2 +37,10 @@

$("#grid").append(grid.render().el);
// Listen to state changes
colManager.on("state-changed", function (state) {
console.log("state changed: ", state);
});
colManager.on("state-saved", function () {
console.log("state saved!");
});
```

@@ -35,0 +47,0 @@

@@ -559,3 +559,3 @@ "use strict";

this.ItemView = (opts.DropdownItemView instanceof Backbone.View) ? opts.DropdownItemView : DropDownItemView;
this.button = opts.button;
this.$dropdownButton = opts.$dropdownButton;

@@ -598,3 +598,3 @@ this.on("dropdown:opened", this.open, this);

// Get button
var $button = this.$el.parent().find(".dropdown-button").first();
var $button = this.$dropdownButton;

@@ -754,2 +754,5 @@ // Align

// Create button element
this.$dropdownButton = $(this.options.buttonTemplate());
var viewOptions = {

@@ -759,3 +762,4 @@ columnManager: this.columnManager,

dropdownItemTemplate: this.options.dropdownItemTemplate,
align: this.options.dropdownAlign
align: this.options.dropdownAlign,
$dropdownButton: this.$dropdownButton
};

@@ -762,0 +766,0 @@

@@ -121,7 +121,9 @@ /*global jasmine, describe, beforeEach, it, expect, spyOn, Backgrid */

var nameCompare = function(a,b) {
if (a.name < b.name)
var nameCompare = function(a, b) {
if (a.name < b.name) {
return -1;
if (a.name > b.name)
}
if (a.name > b.name) {
return 1;
}
return 0;

@@ -128,0 +130,0 @@ };