In my portal, I have a custom list that is using grouping. Now, I want to automatically expand all the groups, so I have mustered this javascript/jQuery function. I use a delaying function to load it after the UI. The function gets called (the first popup works), but the javascript fails (the second popup never fires).
function AutoExpandList(collapsemode){
alert("function called");
if(collapsemode){
$("img[src$='minus.gif']:visible").parent().click();
}else{
$("img[src$='plus.gif']:visible").parent().click();
}
alert("function completed");
}
The original idea for the wildcard-path was an accepted solution from here. There is a similar SSE post here, but with no viable solution for Sharepoint 2010, so I came up with this.
[edit]
The function gets called just fine. For example, depending on the parameter, I get an alert in either instance:
function AutoExpandList(collapsemode){
alert("mode1");
}else{
alert("mode2");
}
Which means there is an error in the jQuery somewhere (I'm running jQuery v1.10.2).
[update]
Okay, I've figured something out. The jQuery fires just fine in a view where inline editing is not enabled. But for some unknown reason, if inline editing is enabled, the jquery function breaks.
How can I get this to work? Are there any jQuery experts out there?
alert("function called with " + collapasemode + " using " + $);
if either of those diplays as undefined there's your problemfunction called with 0 using function (e,t){return new x.fn.init(e,t,r)}
- which at least means the jquery is firing. The0
is the parameter I am specifying in the function call - so that is correct, too.