From 56c21400704716bb550239f3549cc1450ed1f8fb Mon Sep 17 00:00:00 2001 From: Jon Hynes Date: Wed, 15 May 2024 12:52:18 -0400 Subject: [PATCH 1/6] Shift select to be consistently ordered --- Griddly.NetCore.Razor/wwwroot/js/griddly.js | 9 +++++---- Griddly/Scripts/griddly.js | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Griddly.NetCore.Razor/wwwroot/js/griddly.js b/Griddly.NetCore.Razor/wwwroot/js/griddly.js index 626f5b5..d175030 100644 --- a/Griddly.NetCore.Razor/wwwroot/js/griddly.js +++ b/Griddly.NetCore.Razor/wwwroot/js/griddly.js @@ -1065,10 +1065,7 @@ } } - setRowSelect($checkbox); - - if (event.shiftKey && this.options.lastSelectedRow) - { + if (event.shiftKey && this.options.lastSelectedRow) { var last = $("tbody tr", this.$element).index(this.options.lastSelectedRow); var first = $("tbody tr", this.$element).index($target.parents("tr")); var newstate = this.options.lastSelectedRow.find("input[name=_rowselect]").prop("checked"); @@ -1077,9 +1074,13 @@ var end = Math.max(first, last); $("tbody tr", this.$element).slice(start, end).find("input[name=_rowselect]").each(function () { $(this).prop("checked", newstate); setRowSelect($(this), true) }); + setRowSelect($checkbox); onRowChange(); } + else { + setRowSelect($checkbox); + } this.options.lastSelectedRow = $target.parents("tr"); }, this)); diff --git a/Griddly/Scripts/griddly.js b/Griddly/Scripts/griddly.js index 626f5b5..d175030 100644 --- a/Griddly/Scripts/griddly.js +++ b/Griddly/Scripts/griddly.js @@ -1065,10 +1065,7 @@ } } - setRowSelect($checkbox); - - if (event.shiftKey && this.options.lastSelectedRow) - { + if (event.shiftKey && this.options.lastSelectedRow) { var last = $("tbody tr", this.$element).index(this.options.lastSelectedRow); var first = $("tbody tr", this.$element).index($target.parents("tr")); var newstate = this.options.lastSelectedRow.find("input[name=_rowselect]").prop("checked"); @@ -1077,9 +1074,13 @@ var end = Math.max(first, last); $("tbody tr", this.$element).slice(start, end).find("input[name=_rowselect]").each(function () { $(this).prop("checked", newstate); setRowSelect($(this), true) }); + setRowSelect($checkbox); onRowChange(); } + else { + setRowSelect($checkbox); + } this.options.lastSelectedRow = $target.parents("tr"); }, this)); From 126e7da7ddd47eb6276553ee6688bc072aa6b38e Mon Sep 17 00:00:00 2001 From: Jon Hynes Date: Fri, 7 Jun 2024 17:11:56 -0400 Subject: [PATCH 2/6] Add setting for export function --- Build/CommonAssemblyInfo.cs | 6 +++--- Griddly.NetCore.Razor/wwwroot/js/griddly.js | 10 ++++++---- Griddly/Scripts/griddly.js | 10 ++++++---- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Build/CommonAssemblyInfo.cs b/Build/CommonAssemblyInfo.cs index 6db99c7..6724b71 100644 --- a/Build/CommonAssemblyInfo.cs +++ b/Build/CommonAssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyProduct("Griddly")] -[assembly: AssemblyCopyright("Copyright © 2013-2023 Chris Hynes, Joel Potter, and Data Research Group")] +[assembly: AssemblyCopyright("Copyright © 2013-2024 Chris Hynes, Joel Potter, and Data Research Group")] [assembly: ComVisible(false)] @@ -15,6 +15,6 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("3.6.39")] -[assembly: AssemblyFileVersion("3.6.39")] +[assembly: AssemblyVersion("3.6.40")] +[assembly: AssemblyFileVersion("3.6.40")] //[assembly: AssemblyInformationalVersion("2.5-filters")] diff --git a/Griddly.NetCore.Razor/wwwroot/js/griddly.js b/Griddly.NetCore.Razor/wwwroot/js/griddly.js index d175030..b55f502 100644 --- a/Griddly.NetCore.Razor/wwwroot/js/griddly.js +++ b/Griddly.NetCore.Razor/wwwroot/js/griddly.js @@ -1107,17 +1107,17 @@ }, this)); $("a.export-xlsx", this.$element).on("click", $.proxy(function (e) { - this.exportFile("xlsx", null, { exportName: $(e.target).data("export-name") }); + this.exportFile("xlsx", this.options.exportFunction, { exportName: $(e.target).data("export-name") }); e.preventDefault(); }, this)); $("a.export-csv", this.$element).on("click", $.proxy(function (e) { - this.exportFile("csv", null, { exportName: $(e.target).data("export-name") }); + this.exportFile("csv", this.options.exportFunction, { exportName: $(e.target).data("export-name") }); e.preventDefault(); }, this)); $("a.export-tsv", this.$element).on("click", $.proxy(function (e) { - this.exportFile("tsv", null, { exportName: $(e.target).data("export-name") }); + this.exportFile("tsv", this.options.exportFunction, { exportName: $(e.target).data("export-name") }); e.preventDefault(); }, this)); @@ -2045,7 +2045,9 @@ confirmPromptFunction: null, renderFilterDisplay: renderFilterDisplayImpl, serializeSkipEmpty: true, - filtersSelector: "input[name], select[name]" + filtersSelector: "input[name], select[name]", + exportCustomFunction: null, + exportFunction: null }, $.fn.griddlyGlobalDefaults); var GriddlyFilterBar = function (element, options) diff --git a/Griddly/Scripts/griddly.js b/Griddly/Scripts/griddly.js index d175030..b55f502 100644 --- a/Griddly/Scripts/griddly.js +++ b/Griddly/Scripts/griddly.js @@ -1107,17 +1107,17 @@ }, this)); $("a.export-xlsx", this.$element).on("click", $.proxy(function (e) { - this.exportFile("xlsx", null, { exportName: $(e.target).data("export-name") }); + this.exportFile("xlsx", this.options.exportFunction, { exportName: $(e.target).data("export-name") }); e.preventDefault(); }, this)); $("a.export-csv", this.$element).on("click", $.proxy(function (e) { - this.exportFile("csv", null, { exportName: $(e.target).data("export-name") }); + this.exportFile("csv", this.options.exportFunction, { exportName: $(e.target).data("export-name") }); e.preventDefault(); }, this)); $("a.export-tsv", this.$element).on("click", $.proxy(function (e) { - this.exportFile("tsv", null, { exportName: $(e.target).data("export-name") }); + this.exportFile("tsv", this.options.exportFunction, { exportName: $(e.target).data("export-name") }); e.preventDefault(); }, this)); @@ -2045,7 +2045,9 @@ confirmPromptFunction: null, renderFilterDisplay: renderFilterDisplayImpl, serializeSkipEmpty: true, - filtersSelector: "input[name], select[name]" + filtersSelector: "input[name], select[name]", + exportCustomFunction: null, + exportFunction: null }, $.fn.griddlyGlobalDefaults); var GriddlyFilterBar = function (element, options) From fc6802491f78928a5705000e553be61633ced201 Mon Sep 17 00:00:00 2001 From: Jon Hynes Date: Fri, 7 Jun 2024 17:14:27 -0400 Subject: [PATCH 3/6] Update to 2024 --- .../Pages/Shared/Griddly/BootstrapButton.cshtml | 2 +- Griddly.NetCore.Razor/Pages/Shared/Griddly/ButtonStrip.cshtml | 2 +- Griddly.NetCore.Razor/Pages/Shared/Griddly/Griddly.cshtml | 2 +- .../Pages/Shared/Griddly/GriddlyFilterBar.cshtml | 2 +- .../Pages/Shared/Griddly/GriddlyFilterForm.cshtml | 2 +- .../Pages/Shared/Griddly/GriddlyFilterInline.cshtml | 2 +- .../Pages/Shared/Griddly/GriddlyFilterValues.cshtml | 2 +- .../Pages/Shared/Griddly/GriddlyFilters.cshtml | 2 +- Griddly.NetCore.Razor/wwwroot/js/griddly.js | 2 +- Griddly/Scripts/griddly.js | 2 +- Griddly/Views/Shared/Griddly/BootstrapButton.cshtml | 2 +- Griddly/Views/Shared/Griddly/ButtonStrip.cshtml | 2 +- Griddly/Views/Shared/Griddly/Griddly.cshtml | 2 +- Griddly/Views/Shared/Griddly/GriddlyFilterBar.cshtml | 2 +- Griddly/Views/Shared/Griddly/GriddlyFilterForm.cshtml | 2 +- Griddly/Views/Shared/Griddly/GriddlyFilterInline.cshtml | 2 +- Griddly/Views/Shared/Griddly/GriddlyFilterValues.cshtml | 2 +- Griddly/Views/Shared/Griddly/GriddlyFilters.cshtml | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Griddly.NetCore.Razor/Pages/Shared/Griddly/BootstrapButton.cshtml b/Griddly.NetCore.Razor/Pages/Shared/Griddly/BootstrapButton.cshtml index affb920..c49c6b4 100644 --- a/Griddly.NetCore.Razor/Pages/Shared/Griddly/BootstrapButton.cshtml +++ b/Griddly.NetCore.Razor/Pages/Shared/Griddly/BootstrapButton.cshtml @@ -1,7 +1,7 @@ @* * GriddlyButton renderer using Bootstrap html and styles * http://griddly.com - * Copyright 2013-2023 Chris Hynes and Data Research Group, Inc. + * Copyright 2013-2024 Chris Hynes and Data Research Group, Inc. * Licensed under MIT (https://github.com/programcsharp/griddly/blob/master/LICENSE) * * WARNING: Don't edit this file -- it'll be overwitten when you upgrade. diff --git a/Griddly.NetCore.Razor/Pages/Shared/Griddly/ButtonStrip.cshtml b/Griddly.NetCore.Razor/Pages/Shared/Griddly/ButtonStrip.cshtml index d6b107a..c21d751 100644 --- a/Griddly.NetCore.Razor/Pages/Shared/Griddly/ButtonStrip.cshtml +++ b/Griddly.NetCore.Razor/Pages/Shared/Griddly/ButtonStrip.cshtml @@ -1,7 +1,7 @@ @* * GriddlyButton button strip renderer using Bootstrap html and styles * http://griddly.com - * Copyright 2013-2023 Chris Hynes and Data Research Group, Inc. + * Copyright 2013-2024 Chris Hynes and Data Research Group, Inc. * Licensed under MIT (https://github.com/programcsharp/griddly/blob/master/LICENSE) * * WARNING: Don't edit this file -- it'll be overwitten when you upgrade. diff --git a/Griddly.NetCore.Razor/Pages/Shared/Griddly/Griddly.cshtml b/Griddly.NetCore.Razor/Pages/Shared/Griddly/Griddly.cshtml index 5e5f32c..9eb1130 100644 --- a/Griddly.NetCore.Razor/Pages/Shared/Griddly/Griddly.cshtml +++ b/Griddly.NetCore.Razor/Pages/Shared/Griddly/Griddly.cshtml @@ -1,7 +1,7 @@ @* * Griddly renderer * http://griddly.com - * Copyright 2013-2023 Chris Hynes and Data Research Group, Inc. + * Copyright 2013-2024 Chris Hynes and Data Research Group, Inc. * Licensed under MIT (https://github.com/programcsharp/griddly/blob/master/LICENSE) * * WARNING: Don't edit this file -- it'll be overwitten when you upgrade. diff --git a/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilterBar.cshtml b/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilterBar.cshtml index b77e1ad..1b9beef 100644 --- a/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilterBar.cshtml +++ b/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilterBar.cshtml @@ -1,7 +1,7 @@ @* * GriddlyFilterBar renderer using Bootstrap html and styles * http://griddly.com - * Copyright 2013-2023 Chris Hynes and Data Research Group, Inc. + * Copyright 2013-2024 Chris Hynes and Data Research Group, Inc. * Licensed under MIT (https://github.com/programcsharp/griddly/blob/master/LICENSE) * * WARNING: Don't edit this file -- it'll be overwitten when you upgrade. diff --git a/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilterForm.cshtml b/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilterForm.cshtml index d47e9fb..ad8d19f 100644 --- a/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilterForm.cshtml +++ b/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilterForm.cshtml @@ -1,7 +1,7 @@ @* * GriddlyFilter form renderer using Bootstrap html and styles * http://griddly.com - * Copyright 2013-2023 Chris Hynes and Data Research Group, Inc. + * Copyright 2013-2024 Chris Hynes and Data Research Group, Inc. * Licensed under MIT (https://github.com/programcsharp/griddly/blob/master/LICENSE) * * WARNING: Don't edit this file -- it'll be overwitten when you upgrade. diff --git a/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilterInline.cshtml b/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilterInline.cshtml index f311486..a8b4e9a 100644 --- a/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilterInline.cshtml +++ b/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilterInline.cshtml @@ -1,7 +1,7 @@ @* * GriddlyFilter inline renderer * http://griddly.com - * Copyright 2013-2023 Chris Hynes and Data Research Group, Inc. + * Copyright 2013-2024 Chris Hynes and Data Research Group, Inc. * Licensed under MIT (https://github.com/programcsharp/griddly/blob/master/LICENSE) * * WARNING: Don't edit this file -- it'll be overwitten when you upgrade. diff --git a/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilterValues.cshtml b/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilterValues.cshtml index 4691daa..424a444 100644 --- a/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilterValues.cshtml +++ b/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilterValues.cshtml @@ -1,7 +1,7 @@ @* * GriddlyFilter value renderer using Bootstrap html and styles * http://griddly.com - * Copyright 2013-2023 Chris Hynes and Data Research Group, Inc. + * Copyright 2013-2024 Chris Hynes and Data Research Group, Inc. * Licensed under MIT (https://github.com/programcsharp/griddly/blob/master/LICENSE) * * WARNING: Don't edit this file -- it'll be overwitten when you upgrade. diff --git a/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilters.cshtml b/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilters.cshtml index a025a54..44136d4 100644 --- a/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilters.cshtml +++ b/Griddly.NetCore.Razor/Pages/Shared/Griddly/GriddlyFilters.cshtml @@ -1,7 +1,7 @@ @* * GriddlyFilters section renderer using Bootstrap html and styles * http://griddly.com - * Copyright 2013-2023 Chris Hynes and Data Research Group, Inc. + * Copyright 2013-2024 Chris Hynes and Data Research Group, Inc. * Licensed under MIT (https://github.com/programcsharp/griddly/blob/master/LICENSE) * * WARNING: Don't edit this file -- it'll be overwitten when you upgrade. diff --git a/Griddly.NetCore.Razor/wwwroot/js/griddly.js b/Griddly.NetCore.Razor/wwwroot/js/griddly.js index b55f502..29be516 100644 --- a/Griddly.NetCore.Razor/wwwroot/js/griddly.js +++ b/Griddly.NetCore.Razor/wwwroot/js/griddly.js @@ -1,7 +1,7 @@ /* * Griddly script * http://griddly.com - * Copyright 2013-2023 Chris Hynes and Data Research Group, Inc. + * Copyright 2013-2024 Chris Hynes and Data Research Group, Inc. * Licensed under MIT (https://github.com/programcsharp/griddly/blob/master/LICENSE) * * WARNING: Don't edit this file -- it'll be overwitten when you upgrade. diff --git a/Griddly/Scripts/griddly.js b/Griddly/Scripts/griddly.js index b55f502..29be516 100644 --- a/Griddly/Scripts/griddly.js +++ b/Griddly/Scripts/griddly.js @@ -1,7 +1,7 @@ /* * Griddly script * http://griddly.com - * Copyright 2013-2023 Chris Hynes and Data Research Group, Inc. + * Copyright 2013-2024 Chris Hynes and Data Research Group, Inc. * Licensed under MIT (https://github.com/programcsharp/griddly/blob/master/LICENSE) * * WARNING: Don't edit this file -- it'll be overwitten when you upgrade. diff --git a/Griddly/Views/Shared/Griddly/BootstrapButton.cshtml b/Griddly/Views/Shared/Griddly/BootstrapButton.cshtml index fde4c53..8a38eca 100644 --- a/Griddly/Views/Shared/Griddly/BootstrapButton.cshtml +++ b/Griddly/Views/Shared/Griddly/BootstrapButton.cshtml @@ -1,7 +1,7 @@ @* * GriddlyButton renderer using Bootstrap html and styles * http://griddly.com - * Copyright 2013-2023 Chris Hynes and Data Research Group, Inc. + * Copyright 2013-2024 Chris Hynes and Data Research Group, Inc. * Licensed under MIT (https://github.com/programcsharp/griddly/blob/master/LICENSE) * * WARNING: Don't edit this file -- it'll be overwitten when you upgrade. diff --git a/Griddly/Views/Shared/Griddly/ButtonStrip.cshtml b/Griddly/Views/Shared/Griddly/ButtonStrip.cshtml index b82f055..fec7e12 100644 --- a/Griddly/Views/Shared/Griddly/ButtonStrip.cshtml +++ b/Griddly/Views/Shared/Griddly/ButtonStrip.cshtml @@ -1,7 +1,7 @@ @* * GriddlyButton button strip renderer using Bootstrap html and styles * http://griddly.com - * Copyright 2013-2023 Chris Hynes and Data Research Group, Inc. + * Copyright 2013-2024 Chris Hynes and Data Research Group, Inc. * Licensed under MIT (https://github.com/programcsharp/griddly/blob/master/LICENSE) * * WARNING: Don't edit this file -- it'll be overwitten when you upgrade. diff --git a/Griddly/Views/Shared/Griddly/Griddly.cshtml b/Griddly/Views/Shared/Griddly/Griddly.cshtml index 3eca8e2..bea4871 100644 --- a/Griddly/Views/Shared/Griddly/Griddly.cshtml +++ b/Griddly/Views/Shared/Griddly/Griddly.cshtml @@ -1,7 +1,7 @@ @* * Griddly renderer * http://griddly.com - * Copyright 2013-2023 Chris Hynes and Data Research Group, Inc. + * Copyright 2013-2024 Chris Hynes and Data Research Group, Inc. * Licensed under MIT (https://github.com/programcsharp/griddly/blob/master/LICENSE) * * WARNING: Don't edit this file -- it'll be overwitten when you upgrade. diff --git a/Griddly/Views/Shared/Griddly/GriddlyFilterBar.cshtml b/Griddly/Views/Shared/Griddly/GriddlyFilterBar.cshtml index c799e08..ef13790 100644 --- a/Griddly/Views/Shared/Griddly/GriddlyFilterBar.cshtml +++ b/Griddly/Views/Shared/Griddly/GriddlyFilterBar.cshtml @@ -1,7 +1,7 @@ @* * GriddlyFilterBar renderer using Bootstrap html and styles * http://griddly.com - * Copyright 2013-2023 Chris Hynes and Data Research Group, Inc. + * Copyright 2013-2024 Chris Hynes and Data Research Group, Inc. * Licensed under MIT (https://github.com/programcsharp/griddly/blob/master/LICENSE) * * WARNING: Don't edit this file -- it'll be overwitten when you upgrade. diff --git a/Griddly/Views/Shared/Griddly/GriddlyFilterForm.cshtml b/Griddly/Views/Shared/Griddly/GriddlyFilterForm.cshtml index 9f4368f..c9150ed 100644 --- a/Griddly/Views/Shared/Griddly/GriddlyFilterForm.cshtml +++ b/Griddly/Views/Shared/Griddly/GriddlyFilterForm.cshtml @@ -1,7 +1,7 @@ @* * GriddlyFilter form renderer using Bootstrap html and styles * http://griddly.com - * Copyright 2013-2023 Chris Hynes and Data Research Group, Inc. + * Copyright 2013-2024 Chris Hynes and Data Research Group, Inc. * Licensed under MIT (https://github.com/programcsharp/griddly/blob/master/LICENSE) * * WARNING: Don't edit this file -- it'll be overwitten when you upgrade. diff --git a/Griddly/Views/Shared/Griddly/GriddlyFilterInline.cshtml b/Griddly/Views/Shared/Griddly/GriddlyFilterInline.cshtml index f82f1bf..f7bf6ed 100644 --- a/Griddly/Views/Shared/Griddly/GriddlyFilterInline.cshtml +++ b/Griddly/Views/Shared/Griddly/GriddlyFilterInline.cshtml @@ -1,7 +1,7 @@ @* * GriddlyFilter inline renderer * http://griddly.com - * Copyright 2013-2023 Chris Hynes and Data Research Group, Inc. + * Copyright 2013-2024 Chris Hynes and Data Research Group, Inc. * Licensed under MIT (https://github.com/programcsharp/griddly/blob/master/LICENSE) * * WARNING: Don't edit this file -- it'll be overwitten when you upgrade. diff --git a/Griddly/Views/Shared/Griddly/GriddlyFilterValues.cshtml b/Griddly/Views/Shared/Griddly/GriddlyFilterValues.cshtml index 5a67a5a..1521497 100644 --- a/Griddly/Views/Shared/Griddly/GriddlyFilterValues.cshtml +++ b/Griddly/Views/Shared/Griddly/GriddlyFilterValues.cshtml @@ -1,7 +1,7 @@ @* * GriddlyFilter value renderer using Bootstrap html and styles * http://griddly.com - * Copyright 2013-2023 Chris Hynes and Data Research Group, Inc. + * Copyright 2013-2024 Chris Hynes and Data Research Group, Inc. * Licensed under MIT (https://github.com/programcsharp/griddly/blob/master/LICENSE) * * WARNING: Don't edit this file -- it'll be overwitten when you upgrade. diff --git a/Griddly/Views/Shared/Griddly/GriddlyFilters.cshtml b/Griddly/Views/Shared/Griddly/GriddlyFilters.cshtml index d88bd30..f4601f1 100644 --- a/Griddly/Views/Shared/Griddly/GriddlyFilters.cshtml +++ b/Griddly/Views/Shared/Griddly/GriddlyFilters.cshtml @@ -1,7 +1,7 @@ @* * GriddlyFilters section renderer using Bootstrap html and styles * http://griddly.com - * Copyright 2013-2023 Chris Hynes and Data Research Group, Inc. + * Copyright 2013-2024 Chris Hynes and Data Research Group, Inc. * Licensed under MIT (https://github.com/programcsharp/griddly/blob/master/LICENSE) * * WARNING: Don't edit this file -- it'll be overwitten when you upgrade. From 6244474019e5fa1e551cf150f38b607227671e80 Mon Sep 17 00:00:00 2001 From: mayur-ownerrez Date: Mon, 10 Jun 2024 17:08:55 -0400 Subject: [PATCH 4/6] Don't select disabled --- Griddly/Scripts/griddly.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Griddly/Scripts/griddly.js b/Griddly/Scripts/griddly.js index 29be516..3e1ad91 100644 --- a/Griddly/Scripts/griddly.js +++ b/Griddly/Scripts/griddly.js @@ -1087,10 +1087,10 @@ $(this.$element).on("click", "thead tr.columnHeaders th.select", $.proxy(function (event) { - if (this.$element.find("input[name=_rowselect]:not(:checked)").length == 0) - this.$element.find("input[name=_rowselect]").prop("checked", false).each(function () { setRowSelect($(this), true); }); + if (this.$element.find("input[name=_rowselect]:not(:checked):not(:disabled)").length == 0) + this.$element.find("input[name=_rowselect]:not(:disabled)").prop("checked", false).each(function () { setRowSelect($(this), true); }); else - this.$element.find("input[name=_rowselect]").prop("checked", true).each(function () { setRowSelect($(this), true); }); + this.$element.find("input[name=_rowselect]:not(:disabled)").prop("checked", true).each(function () { setRowSelect($(this), true); }); onRowChange(); }, this)); From 799cf2ddffaa3a30ad7c16f6e573679436afe0f0 Mon Sep 17 00:00:00 2001 From: mayur-ownerrez Date: Mon, 10 Jun 2024 17:09:18 -0400 Subject: [PATCH 5/6] Don't select disabled --- Griddly.NetCore.Razor/wwwroot/js/griddly.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Griddly.NetCore.Razor/wwwroot/js/griddly.js b/Griddly.NetCore.Razor/wwwroot/js/griddly.js index 29be516..3e1ad91 100644 --- a/Griddly.NetCore.Razor/wwwroot/js/griddly.js +++ b/Griddly.NetCore.Razor/wwwroot/js/griddly.js @@ -1087,10 +1087,10 @@ $(this.$element).on("click", "thead tr.columnHeaders th.select", $.proxy(function (event) { - if (this.$element.find("input[name=_rowselect]:not(:checked)").length == 0) - this.$element.find("input[name=_rowselect]").prop("checked", false).each(function () { setRowSelect($(this), true); }); + if (this.$element.find("input[name=_rowselect]:not(:checked):not(:disabled)").length == 0) + this.$element.find("input[name=_rowselect]:not(:disabled)").prop("checked", false).each(function () { setRowSelect($(this), true); }); else - this.$element.find("input[name=_rowselect]").prop("checked", true).each(function () { setRowSelect($(this), true); }); + this.$element.find("input[name=_rowselect]:not(:disabled)").prop("checked", true).each(function () { setRowSelect($(this), true); }); onRowChange(); }, this)); From ec9456de5ecb6f208f510529b0bd551148fd098e Mon Sep 17 00:00:00 2001 From: mayur-ownerrez Date: Wed, 26 Jun 2024 13:37:45 -0400 Subject: [PATCH 6/6] Added support for grid identefier --- Griddly.Mvc/GriddlyExtensions.cs | 19 +++++++++++++++---- .../Views/Home/MultipleDefaultTest.cshtml | 10 +++++++--- Griddly/Views/Home/MultipleDefaultTest.cshtml | 10 +++++++--- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/Griddly.Mvc/GriddlyExtensions.cs b/Griddly.Mvc/GriddlyExtensions.cs index 03e6e7f..d4ce1fd 100644 --- a/Griddly.Mvc/GriddlyExtensions.cs +++ b/Griddly.Mvc/GriddlyExtensions.cs @@ -530,12 +530,23 @@ private static GriddlyContext GetOrCreateGriddlyContext(RouteData routeData, Htt sortFields = GriddlyResult.GetSortFields(items); +#if NETFRAMEWORK + string cookieSuffix = (controller.ControllerContext.RouteData.Values["GridIdentifier"] as string); +#else + string cookieSuffix = (routeData.Values["GridIdentifier"] as string); +#endif + + if (string.IsNullOrEmpty(cookieSuffix)) + cookieSuffix = items["GridIdentifier"]; + + cookieSuffix = !string.IsNullOrEmpty(cookieSuffix) ? "_" + cookieSuffix.ToLower() : string.Empty; + context = new GriddlyContext() { #if NETFRAMEWORK - Name = (controller.GetType().Name + "_" + controller.ControllerContext.RouteData.Values["action"] as string).ToLower(), + Name = (controller.GetType().Name + "_" + controller.ControllerContext.RouteData.Values["action"] as string).ToLower() + cookieSuffix, #else - Name = (routeData.Values["controller"] as string).ToLower() + "_" + (routeData.Values["action"] as string).ToLower(), + Name = (routeData.Values["controller"] as string).ToLower() + "_" + (routeData.Values["action"] as string).ToLower() + cookieSuffix, #endif PageNumber = pageNumber, PageSize = pageSize, @@ -622,7 +633,7 @@ public static string Current(this IUrlHelper helper, ViewContext vc, object rout { if (arrayVals.Length > 0) arrayVals.Append("&"); - arrayVals.Append(string.Join("&", ((IEnumerable)value.Value).Cast().Select(x=> value.Key + "=" + x?.ToString()))); + arrayVals.Append(string.Join("&", ((IEnumerable)value.Value).Cast().Select(x => value.Key + "=" + x?.ToString()))); } } } @@ -656,7 +667,7 @@ public static string Current(this IUrlHelper helper, ViewContext vc, object rout } var route = helper.RouteUrl(values); - if(arrayVals.Length>0) + if (arrayVals.Length > 0) { route += (route.Contains("?") ? "&" : "?") + arrayVals.ToString(); } diff --git a/Griddly.NetCore/Views/Home/MultipleDefaultTest.cshtml b/Griddly.NetCore/Views/Home/MultipleDefaultTest.cshtml index fd892f8..6a1c23d 100644 --- a/Griddly.NetCore/Views/Home/MultipleDefaultTest.cshtml +++ b/Griddly.NetCore/Views/Home/MultipleDefaultTest.cshtml @@ -6,8 +6,12 @@

Multiple Default Test

Grid 1

- @await Html.GriddlyAsync("Test1Grid") -

Grid 2

- @await Html.GriddlyAsync("Test2Grid") + @await Html.GriddlyAsync("Test1Grid", new { GridIdentifier = "Original" }) +

Copy Grid 1

+ @await Html.GriddlyAsync("Test1Grid", new { GridIdentifier = "Copy" }) +

Original Grid 2

+ @await Html.GriddlyAsync("Test2Grid", new { GridIdentifier = "Original" }) +

Copy Grid 2

+ @await Html.GriddlyAsync("Test2Grid", new { GridIdentifier = "Copy" })
\ No newline at end of file diff --git a/Griddly/Views/Home/MultipleDefaultTest.cshtml b/Griddly/Views/Home/MultipleDefaultTest.cshtml index 10f05a2..963d60d 100644 --- a/Griddly/Views/Home/MultipleDefaultTest.cshtml +++ b/Griddly/Views/Home/MultipleDefaultTest.cshtml @@ -6,8 +6,12 @@

Multiple Default Test

Grid 1

- @Html.Griddly("Test1Grid") -

Grid 2

- @Html.Griddly("Test2Grid") + @Html.Griddly("Test1Grid", new { GridIdentifier = "Original" }) +

Copy Grid 1

+ @Html.Griddly("Test1Grid", new { GridIdentifier = "Copy" }) +

Original Grid 2

+ @Html.Griddly("Test2Grid", new { GridIdentifier = "Original" }) +

Copy Grid 2

+ @Html.Griddly("Test2Grid", new { GridIdentifier = "Copy" })
\ No newline at end of file