I could swear I saw something about this in a post once, but can't find it now.
I have a query with groups that I would like to have open up with the first group expanded automatically, but the rest closed.
Is that possible?
Open Grouped Query with 1st Group expanded and the rest collapsed
-
- Posts: 303
- Joined: Wed Apr 22, 2015 11:44 pm
Re: Open Grouped Query with 1st Group expanded and the rest collapsed
Search for “Jaymertip expand”
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
Jaymer
Aware Programming & Consulting - Tampa FL
-
- Posts: 303
- Joined: Wed Apr 22, 2015 11:44 pm
Re: Open Grouped Query with 1st Group expanded and the rest collapsed
Thanks Jaymer, I tried that and it doesn't open the row I want.
This is what I ended up putting in the render script:
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]);
}
I do have the Group set to be collapsed initially. I tried it with that option unchecked and it opened all of the groups just like it normally woudl.
Am I missing something here?
This is what I ended up putting in the render script:
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]);
}
I do have the Group set to be collapsed initially. I tried it with that option unchecked and it opened all of the groups just like it normally woudl.
Am I missing something here?
Re: Open Grouped Query with 1st Group expanded and the rest collapsed
your code uses some double quotes, where mine has single.
thats 1 diff. i see - no idea if that makes a difference
also, after the row variable gets set, you can try
console.log(row);
and see what prints.
thats 1 diff. i see - no idea if that makes a difference
also, after the row variable gets set, you can try
console.log(row);
and see what prints.
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
Jaymer
Aware Programming & Consulting - Tampa FL