Monday, May 28, 2012

jQuery - Extension to SPServices.SPCascadeDropdowns

We use SPServices.SPCascadeDropdowns , after 20 items it looks like this:




Instead of:









but the problem is that it doesn't work with Wiki Pages.
Therefore I wrote little extension which helps me to solve this problem.

I changed two things:
1.
After : "var defaultViewUrl = $(this).attr("DefaultViewUrl");"
insert code :

if (listPath.indexOf('/PAGES/') > 0)
{ listPath = listPath + 'FORMS/'; }



2.
Instead of "$(columnSelect.Obj).closest("td").prepend(simpleSelect);"
replace with :

if ($(columnSelect.Obj).closest("td").length)
{ $(columnSelect.Obj).closest("td").prepend(simpleSelect); }
else
{ $(columnSelect.Obj).closest("span").prepend(simpleSelect); }


No comments:

Post a Comment