Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Features from cwohlman fork #282

Open
wants to merge 68 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
dd86e32
Updated the koGrid to match changes I made for bug fixes and feature …
cwohlman Jun 7, 2013
8900023
Added a script to build koGrid as an AMD module, kept separate output…
cwohlman Jun 7, 2013
a932205
Added more changes to the koGrid from my work on the original file
cwohlman Jun 7, 2013
12a98f1
Fixed a bug that resulted in invalid indexs being used. Column indexe…
cwohlman Jun 7, 2013
dee7362
Update row factory to correctly handle collapsed agg rows.
cwohlman Aug 3, 2013
e74b2dd
Fix group logic to preserve sort order of rows.
cwohlman Dec 5, 2013
8a87880
Preserve grid sorting after a flexview refresh
cwohlman Dec 5, 2013
744ebcd
Allow user to sort a grouped column by clicking on the group name.
cwohlman Dec 5, 2013
3c6ce1a
Primitive use of the group column to sort by groups
cwohlman Dec 5, 2013
644c139
Complete group column sorting.
cwohlman Dec 5, 2013
bd287af
Update grid to show child records - except in case of the hideChildre…
cwohlman Dec 5, 2013
8dfea45
Misc fixes - show lowest grid level, show all rows, hide lowest level
cwohlman Dec 5, 2013
3aa0a58
Finalize Changes fixes, linenum
cwohlman Dec 5, 2013
4ac77dc
Stub in Group Totals
cwohlman Dec 6, 2013
154589e
Allow aggregate rows to be selected
cwohlman Dec 6, 2013
a1587d5
Prevent agg cell clicks from affecting selection.
cwohlman Dec 6, 2013
ae8a147
Add (disabled) code to make the group column show line numbers
cwohlman Dec 6, 2013
a093dcc
Add aggregationProvider.js to kogrid
cwohlman Dec 6, 2013
c933f99
Move lineNum to renderChangeNoGroups
cwohlman Dec 6, 2013
0b6a4f6
Update extended selection to work with grouping
cwohlman Dec 6, 2013
84051fb
Add a performance fix to the way row selection is extended.
cwohlman Dec 6, 2013
b8285b5
Stub in cell selection to kogrid.
cwohlman Dec 6, 2013
09181e2
Add cell selection to koGrid
cwohlman Dec 7, 2013
389f2f9
Add cell selection to aggregate rows.
cwohlman Dec 7, 2013
4642e58
Add logic to rowFactory.js to clearout cell selection for aggregate r…
cwohlman Dec 7, 2013
4ce2c1a
Change stripping on grid to reflect group totals changes
cwohlman Dec 7, 2013
09803ed
Improvements to group totals - add a key field and populate grouped f…
cwohlman Dec 7, 2013
b5da6db
Add a build script to run both build.ps1 and buildamd.ps1
cwohlman Dec 7, 2013
8ca913d
Add missing colDef property (config for column, config.colDef for row…
cwohlman Dec 7, 2013
fc5850d
Fix a bug in aggregation - the test for 'groupIndex' was not valid,
cwohlman Dec 7, 2013
b9c2b14
Fix rowFactory.js to present unstringified values (ie numbers, null, …
cwohlman Dec 7, 2013
4224b68
Add group column when rows are grouped, hide grouped column when colu…
cwohlman Dec 7, 2013
6c445d3
Make agg teplate mirror row template, add selectable to column def.
cwohlman Dec 9, 2013
490ad4e
Update selectionService.js to make cell selection reflect row selection.
cwohlman Dec 9, 2013
a564a8c
Change selection to clear selection if control or shift keys not pres…
cwohlman Dec 9, 2013
cd4f5d1
Fix a bug in row, where cellselection was not defined before a call t…
cwohlman Dec 9, 2013
8181bed
Fix a bug where selectionService.js didn't turn off the $$selectionPh…
cwohlman Dec 9, 2013
689261b
Update the way the grid does selection on init - fix several bugs
cwohlman Dec 9, 2013
74dd47b
Add basic grid footer.
cwohlman Jan 28, 2014
1d3c464
Update grid to use a better title for the group column.
cwohlman Jan 28, 2014
681312b
Add support for lineNum column
cwohlman Jan 28, 2014
9283615
Add support for lineNum, remove rows, remove agg rows.
cwohlman Jan 29, 2014
576892d
Add support for remembering the expanded (and selected) state of aggr…
cwohlman Jan 29, 2014
a1ec56e
Revert and Re-implement "Add support for remembering the expanded (an…
cwohlman Jan 29, 2014
0ba74f1
More fixes - grid is still buggy
cwohlman Jan 30, 2014
beff94d
Revert "Add support for remembering the expanded (and selected) state…
cwohlman Jan 30, 2014
ef3b39f
Add support for caching the expanded/collapsed and selected state of …
cwohlman Jan 30, 2014
7dd2543
Update grid to keep grid selection properties in sync with entity and…
cwohlman Jan 30, 2014
e1e9eca
Fix a bug in rowFactory.js where entity rows did not hide themselves …
cwohlman Jan 30, 2014
bfe624e
Fix misc bugs with entity selection and visibility
cwohlman Jan 30, 2014
4be340c
Add simple support for expanding all of rows a particular group level.
cwohlman Jan 30, 2014
006561d
Add bootstrap plus/minus instead of kg arrows
cwohlman Jan 30, 2014
81d70ac
Fix aggregate to preserve collapsed state of child aggregates when co…
cwohlman Jan 30, 2014
11bf886
Fix misc bugs in eventProvider.js
cwohlman Jan 30, 2014
82fb8cb
Fix a bug in selectionService.js where a mockup row was used in place…
cwohlman Jan 30, 2014
bc16045
Update grid to sort by group column by default.
cwohlman Jan 30, 2014
eea5348
Hide lineNum on aggregate columns, show only on total row.
cwohlman Jan 30, 2014
e59feac
Update grid to show columns on unGroup and hide group column when all…
cwohlman Jan 30, 2014
78e98bf
Fix a bug with group column (no index was specified in colDef), fix a…
cwohlman Feb 11, 2014
085017f
Update KoGrid build scripts to ignore date (future builds will not ca…
cwohlman Feb 13, 2014
6a6a2d5
Stub in recap.htm with a dummy main table.
cwohlman Feb 20, 2014
6235778
Update grid and index to use cellTemplate.js (and smartString.js)
cwohlman Feb 21, 2014
ffd1df5
Polish changes
cwohlman Feb 24, 2014
62c5fa5
Fix bug (and debug switch) in error reporting, fix gridCount aggregat…
cwohlman Feb 24, 2014
38f140b
Fix sorting in the case of formatted strings (like ids)
cwohlman Feb 24, 2014
7ba93e1
Workaround for bug where date strings weren't sorted properly
cwohlman Feb 25, 2014
b0d9613
Update README.md
cwohlman Mar 24, 2014
2960607
Update README.md
cwohlman Mar 24, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 39 additions & 6 deletions KoGrid.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


/******** Grid Global ********/
.kglabel {
display: block;
Expand Down Expand Up @@ -186,16 +186,30 @@
position: absolute;
border-bottom: 1px solid rgb(229, 229, 229);
}
/*
For Grids with group totals we can use a simple css even selector since
we want grouped rows to also have a striped background color,
we'll want to move this css change to a binding when we add in an option for group totals vs group labels.
*/
/*
.kgRow.even {
background-color: rgb(243, 243, 243);
}
.kgRow.odd {
background-color: rgb(253, 253, 253);
}
*/
.kgRow:nth-child(even):not(.selected) {
background-color: #c4dcf2;
}
.kgRow.selected {
background-color: rgb(189, 208, 203);
}

.kgCell.selected {
background-color: rgb(169, 178, 173);
}

/******** Cells ********/

.kgCell {
Expand Down Expand Up @@ -285,25 +299,44 @@ input {
line-height: 20px;
white-space:nowrap;
}
.kgAggArrowExpanded {
.kgAggArrowExpanded, .kgAggArrowCollapsed {
left: 0;
bottom: 0;
width: 20px;
height: 20px;
cursor: pointer;
margin-top: 10px;
margin-left: 5px;
margin-right: 5px;
float: right;
position: relative;
}
.icon- {
position: absolute;
left: 7px;
bottom: 8px;
}
.kgAggArrowExpanded i.icon- {
background-position: -433px -96px;
/* position: absolute;
left: 8px;
bottom: 10px;
width: 0;
height: 0;
border-style: solid;
border-width: 0 0 9px 9px;
border-color: transparent transparent #000000 transparent;
border-color: transparent transparent #000000 transparent;*/
}
.kgAggArrowCollapsed {
position: absolute;
.kgAggArrowCollapsed i.icon- {
background-position: -408px -96px;
/* position: absolute;
left: 8px;
bottom: 10px;
width: 0;
height: 0;
border-style: solid;
border-width: 5px 0 5px 8.7px;
border-color: transparent transparent transparent #000000;
border-color: transparent transparent transparent #000000;*/
}

.kgHeaderButton {
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
#A koGrid Fork
This is a koGrid fork with several features and bugfixes:

- Added grouped rows and aggregation
- Add a footer row which will show totals for each column
- Improve the naming of the group column
- Support for sorting grouped grids
- Create Expand/Collapse-all buttons
- Improve speed of grouped grid, esp when expanding and collapsing rows
- Add an amd module output to the build process
- Add cell selection and improve row selection

To see the grid in action please see the [example page] (http://cwohlman.github.io/KoGrid/)

#koGrid : A Knockout DataGrid#

__Contributors:__
Expand Down
1,000 changes: 843 additions & 157 deletions build/KoGrid.debug.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion build/build-order.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
..\src\templates\gridTemplate.html
..\src\templates\rowTemplate.html
..\src\templates\cellTemplate.html
..\src\templates\aggregateTemplate.html
..\src\templates\aggregateTemplate.js
..\src\templates\headerRowTemplate.html
..\src\templates\headerCellTemplate.html
..\src\templates\aggCellTemplate.html
..\src\bindingHandlers\ko-grid.js
..\src\bindingHandlers\kg-row.js
..\src\bindingHandlers\kg-cell.js
Expand All @@ -24,6 +25,7 @@
..\src\classes\row.js
..\src\classes\searchProvider.js
..\src\classes\selectionService.js
..\src\classes\aggregationProvider.js
..\src\classes\styleProvider.js
..\src\classes\sortService.js
..\src\classes\domUtilityService.js
2 changes: 2 additions & 0 deletions build/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
powershell .\build.ps1
powershell .\buildamd.ps1
4 changes: 2 additions & 2 deletions build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Set-Content $TempFile "/***********************************************";
Add-Content $TempFile "* koGrid JavaScript Library";
Add-Content $TempFile "* Authors: https://github.com/ericmbarnard/koGrid/blob/master/README.md";
Add-Content $TempFile "* License: MIT (http://www.opensource.org/licenses/mit-license.php)";
Add-Content $TempFile "* Compiled At: $compileTime";
#Add-Content $TempFile "* Compiled At: $compileTime";
Add-Content $TempFile "***********************************************/`n"
Add-Content $TempFile "(function (window) {";
Add-Content $TempFile "'use strict';";
Expand All @@ -39,4 +39,4 @@ Add-Content $TempFile "}(window));";
Get-Content $TempFile | Set-Content $OutputFile;
Remove-Item $TempFile -Force;
Copy-Item $OutputFile $FinalFile;
Write-Host "Build Succeeded!"
Write-Host "Build Succeeded!"
44 changes: 44 additions & 0 deletions build/buildamd.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

$CurrentDir = (Get-Location).Path;
$OutPutFile = $CurrentDir + "\koGrid.AMD.debug.js";
$TempFile = $OutPutFile + ".temp";
$FinalFile = "..\koGrid-2.1.1.AMD.debug.js";
$BuildOrder = $CurrentDir + "\build-order.txt";
$commentStart = "<!--";
$commentEnd = "-->";

Write-Host "JSBuild Starting...";
$files = Get-Content $BuildOrder;
$compileTime = Get-Date;

Set-Content $TempFile "/***********************************************";
Add-Content $TempFile "* koGrid JavaScript Library";
Add-Content $TempFile "* Authors: https://github.com/ericmbarnard/koGrid/blob/master/README.md";
Add-Content $TempFile "* License: MIT (http://www.opensource.org/licenses/mit-license.php)";
#Add-Content $TempFile "* Compiled At: $compileTime";
Add-Content $TempFile "***********************************************/`n"
Add-Content $TempFile "define(['jquery', 'knockout'], function (`$, ko) {";
Add-Content $TempFile "(function (window) {";
Add-Content $TempFile "'use strict';";
Foreach ($file in $files){
# Wrap each file output in a new line
Write-Host "Building... $file";
Add-Content $TempFile "`n/***********************************************`n* FILE: $file`n***********************************************/";
$fileContents = Get-Content $file | where {!$_.StartsWith("///")};
if ($fileContents[0].StartsWith("<!--")){
$compiledContent = $fileContents[0].TrimStart($commentStart).TrimEnd($commentEnd).Trim() + " = function(){ return '";
for ($indx = 1; $indx -lt $fileContents.Length; $indx++){
$compiledContent += $fileContents[$indx].Trim().Replace("'", "\'");
}
$compiledContent += "';};";
Add-Content $TempFile $compiledContent;
} else {
Add-Content $TempFile $fileContents;
}
}
Add-Content $TempFile "}(window));";
Add-Content $TempFile "return kg;});";
Get-Content $TempFile | Set-Content $OutputFile;
Remove-Item $TempFile -Force;
Copy-Item $OutputFile $FinalFile;
Write-Host "Build Succeeded!"
Loading