SPArrangeChoices does not show al choices

Feb 16, 2015 at 2:19 PM
Hi! I have a custom list with a choice with 3 options, only choice 2 and 3 show while I use this code, if I change perRow to 3, only choice 3 shows, numbers above that doens't show any choice. Can someone help me please?

</script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2014.02/jquery.SPServices-2014.02.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script type="text/javascript"> jQuery.noConflict(); $(document).ready(function() { $().SPServices.SPArrangeChoices({ columnName: "Choice", perRow: 2 }); }); </script>
Coordinator
Feb 16, 2015 at 2:24 PM
This should work. I assume that the column name is actually "Choice"? What version of SharePoint are you using again?

M.
Feb 16, 2015 at 3:53 PM
I'm using sharepoint 2013, here it is how it shows

http://i.imgur.com/WOmPpMn.png
Feb 17, 2015 at 12:08 PM
Hi Marc, I think version 2014.02 has a bug, I changed to 2014.01 and now the arrange function works fine
Feb 18, 2015 at 1:49 PM
It looks like your references to the scripts are out of order. You should load jQuery first and then SPServices. I'm surprised it's worked at all with those out of order.

Cheers,
Matthew
Mar 1, 2015 at 9:43 PM
Edited Mar 1, 2015 at 9:45 PM
Hi Marc,
I had a similar problem, four short choices of which only the final one showed. I stepped back to the 2014.01 library without other changes and the function showed all choices.
IE11, 11.0.9600.17501, update versions 11.0.15
Sharepoint 2013
Code:
<script language="javascript"
    type="text/javascript"
    src="//ent302.sharepoint.hp.com/teams/SWInfraSplit/jQueryLibraries/jquery-1.11.2.min.js"></script>

<script language="javascript" 
    type="text/javascript" 
    src="//ent302.sharepoint.hp.com/teams/SWInfraSplit/jQueryLibraries/jquery.SPServices-2014.01.min.js"></script>

<script language="javascript" type="text/javascript">

var clientContext;
var website;

// Make sure the SharePoint script file 'sp.js' is loaded before your
// code runs.
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', sharePointReady);

// Create an instance of the current context.
function sharePointReady() {
    clientContext = SP.ClientContext.get_current();
    website = clientContext.get_web();
    clientContext.load(website);
    clientContext.executeQueryAsync(
        Function.createDelegate(this, this.onRequestSucceeded), 
        Function.createDelegate(this, this.onRequestFailed)
    );
}
function onRequestSucceeded(sender, args) {
    $().SPServices.SPArrangeChoices({
        columnName: "TestChoice3",
        perRow: 4
    });
/*  var spservicesVersion = $().SPServices.Version();
    var jqueryVersion= $.fn.jquery;
    alert('SPS URL: ' + website.get_url());
    alert('jquery version: ' + jqueryVersion);
    alert('SPServices version: ' + spservicesVersion);
*/
}
function onRequestFailed(sender, args) {
    alert('Request failed. ' + args.get_message() + 
        '\n' + args.get_stackTrace());
}

</script>
Coordinator
Mar 10, 2015 at 8:39 PM
lcgillies:

Most of that code seems to be unnecessary. Depending on your set up, this should do it.
$(document).ready(function() { 
   $().SPServices.SPArrangeChoices({
        columnName: "TestChoice3",
        perRow: 4
    });
});
M.
May 5, 2015 at 10:13 PM
I have the same issue. Reverting to 2014.01 seemed to fix it (for the SPArrangeChoices function).

I had (4) choices. When I set the perRow to 4, I got the last one only. When set to 99, I got nothing (blank). When set to 2, I got the last 3 choices only.

I am using JQuery 2.1.4 on Sharepoint Online.