Skip to content

Instantly share code, notes, and snippets.

// from line 38520
StickyRowFeature.prototype.checkStickyRows = function () {
var _this = this;
var height = 0;
if (!this.gridOptionsService.isGroupRowsSticky()) {
return this.refreshNodesAndContainerHeight([], height);
}
var stickyRows = [];
var firstPixel = this.rowRenderer.getFirstVisibleVerticalPixel();
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Config
# Load version control information

Sorting Grouped Rows independently of Leaf Rows

Intro

Our users have many different uses of grids, using multiple row groups and sorts. It's been a long time want of our users to sort row groups in certain ways but unfortunately have been unable to do this successfully.

A specific scenario, using ag-grid's demo olympic dataset: There is a table of athletes, grouped by date, then grouped by country. We want to sort the country groups rows by total number of gold medals descending, sort the date group rows by their own date descending and finally sort the athlete (leaf) rows by total number of medals.

Current behaviour

@davidnormo
davidnormo / .gitconfig
Last active February 8, 2023 13:02
.gitconfig
[user]
name = Dave Normington
email = <work.email@address.com> # <--- change this
[alias]
wipe = reset --hard head
l = log --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=short
out-bw = log --pretty=format:'%h %ad %an%d %s' --date=short --no-color
last = log -1 HEAD
ch = checkout
@davidnormo
davidnormo / .tmux.conf
Last active February 8, 2023 12:57
My tmux config
# remap prefix from C-b to ` (backtick)
unbind C-b
set-option -g prefix `
bind-key ` send-prefix
unbind ^A
# Start window numbering at 1
set -g base-index 1
@davidnormo
davidnormo / main.js
Last active May 17, 2022 16:56
jsPDF as email attachment
var pdf = new jsPDF();
pdf.text(0, 0, 'Hello World!');
var pdfBase64 = pdf.output('datauristring');
window.plugin.email.open({
to: ['to@email.com'],
subject: 'New PDF!',
body: 'Hi there, here is that new PDF you wanted!',
isHTML: false,
attachments: [pdfBase64]
@davidnormo
davidnormo / index.js
Last active April 14, 2020 14:43
Jumping steps problem (javascript)
/*
A flight of stairs has `n` steps, you are able to jump 1, 2, or 3 steps at a time.
How many different ways are you able to climb the stairs in different combinations of jumps?
E.g. n = 3 then the answer is 4 because: 111, 21, 12, 3
*/
const replaceIndexWithNum = (str, i, num) => {
return str.substring(0, i)+num+str.substring(i+num)
}
@davidnormo
davidnormo / toDeepEqual.js
Last active September 1, 2017 11:18
Deep equality jasmine 2.3 matcher
"use strict";
var observableDiff = require("deep-diff").observableDiff,
lodash = require("lodash");
function valueToString(target) {
return JSON.stringify(target, function(key, value) {
var type = Object.prototype.toString.call(value);
if (value instanceof jasmine.Any) {
@davidnormo
davidnormo / configToOpts
Created June 24, 2017 01:27
json config file to cmd opts string
#!/usr/local/bin/node
const fs = require('fs');
const configPath = process.argv[2];
fs.readFile(configPath, (err, data) => {
if (err) {
console.error(err);
process.exit(1);
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break