Skip to content

Commit 867ff8a

Browse files
committed
Improved destroy method
1 parent 78bb5cc commit 867ff8a

File tree

8 files changed

+12
-6
lines changed

8 files changed

+12
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
### Enhancements & Features
66
- Fixed table headers
7-
- FIxed table column
7+
- Fixed table column
8+
- Sorted header column CSS class
9+
- Improved destroy method
810

911
### Bug Fixes
1012
- ...

build/jQuery.Bootgrid.1.1.0.nupkg

-22.5 KB
Binary file not shown.

build/jQuery.Bootgrid.1.2.0.nupkg

22.6 KB
Binary file not shown.

build/jquery.bootgrid-1.1.0.zip

-24.1 KB
Binary file not shown.

build/jquery.bootgrid-1.2.0.zip

24.2 KB
Binary file not shown.

build/jquery.bootgrid.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery Bootgrid v1.1.0 - 09/12/2014
2+
* jQuery Bootgrid v1.2.0 - 09/22/2014
33
* Copyright (c) 2014 Rafael Staib (http://www.jquery-bootgrid.com)
44
* Licensed under MIT http://www.opensource.org/licenses/MIT
55
*/
@@ -951,6 +951,7 @@
951951
this.header = null;
952952
this.footer = null;
953953
this.xqr = null;
954+
this.original = this.element.clone();
954955

955956
// todo: implement cache
956957
};
@@ -1298,7 +1299,8 @@
12981299
{
12991300
this.footer.remove();
13001301
}
1301-
this.element.remove("tbody").off(namespace).removeData(namespace);
1302+
// todo: find a better and shorter way to remove events, data and the table itself!
1303+
this.element.before(this.original).off(namespace).removeData(namespace).remove();
13021304

13031305
return this;
13041306
};

build/jquery.bootgrid.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/public.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ var Grid = function(element, options)
3636
this.header = null;
3737
this.footer = null;
3838
this.xqr = null;
39+
this.original = this.element.clone();
3940

4041
// todo: implement cache
4142
};
@@ -383,7 +384,8 @@ Grid.prototype.destroy = function()
383384
{
384385
this.footer.remove();
385386
}
386-
this.element.remove("tbody").off(namespace).removeData(namespace);
387+
// todo: find a better and shorter way to remove events, data and the table itself!
388+
this.element.before(this.original).off(namespace).removeData(namespace).remove();
387389

388390
return this;
389391
};

0 commit comments

Comments
 (0)