Auto expansion of selected Groups in a Grid

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Auto expansion of selected Groups in a Grid

Post by Jaymer »

One annoying thing about Expansion of Rows in a grid is that its either ALL or NONE expanded.
You COULD have more options, but that would require more options in the Aware Dialog to match up with more Kendo options (ie. A lot more work for Support)

To save me from having to create multiple Grids for Projects (Open Projects vs. Close Projects), in this grid I grouped them by Status.
The Closed ones you almost NEVER want to see, so no reason for them to open expanded. So, All have to be collapsed (per Aware's options) and that means the Customer ALWAYS has to expand a group (or two) when viewing this screen.

So here's an example of JS that automatically expands the 1st 2 sections (New and In-Progress).
End Result when the grid appears:
Screen Shot 2020-03-19 at 2.25.39 PM.png
Screen Shot 2020-03-19 at 2.25.39 PM.png (28.56 KiB) Viewed 2900 times
Render script of the Grid:

Code: Select all

var grid = widget;
grid.bind("dataBound", expand);

function expand(e) {
                var row = $('#'+grid.element.attr('id') + ' tr[class="k-grouping-row"]');
                grid.expandRow(row[0]);
                grid.expandRow(row[1]);
}
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: Auto expansion of selected Groups in a Grid

Post by tford »

Very cool!
Tom - V8.8 build 3137 - MySql / PostGres
Post Reply