Hello, I’m using pivot tables and have a number of filter columns that are either select or multiselect. I see no real logic to how the items to choose from are sorted. Is there a way to specify it to sort in alphabetic order? For example, I have a select on “City Name” but they’re all out of order.
Hello,
datatable sorts filter options. Could you please provide a snippet that shows the problem ?
Hi Maria, Here is my pivot:
{
id:“pivot”,
view:“pivot”,
url:<?php echo $dataURL; ?>,
structure: {
rows: [“PickupCity”,“Outcome”],
columns: [‘Dispatch_MonthName’],
values: [
{ name:‘TripCount’, operation:‘sum’},
{ name:‘MinutesToComplete’, operation:‘ave’},
{ name:‘MinutesToComplete’, operation:‘min’},
{ name:‘MinutesToComplete’, operation:‘max’},
{ name:‘MinutesPCRLifetime’, operation:‘ave’},
{ name:‘MinutesPCRLifetime’, operation:‘min’},
{ name:‘MinutesPCRLifetime’, operation:‘max’},
{ name:‘MinutesProcrastinate’, operation:‘ave’},
{ name:‘MinutesProcrastinate’, operation:‘min’},
{ name:‘MinutesProcrastinate’, operation:‘max’},
],
filters:[
{name:"ReportStatus",type:"multiselect"},
{name:"PickupCity",type:"multiselect"}, // Pickup City does not filter for some reason. Need to find out in the forums why
{name:"CallType",type:"multiselect"},
{name:"Outcome",type:"multiselect"},
{name:"Vehicle",type:"multiselect"},
{name:"Dispatch_Weekday",type:"multiselect"},
],
},
My issue is that PickupCity, for example, is loaded by the sort order of the data that I’m pulling in. The data is organized in the logical order that I need it to be in for the pivot to make the most sense to the end user but a result of that is the select used to filter on Pickup City is not in alphabetic order. There are often 100+ entries so having them out of any logical order is a killer.
I believe that datatable is an underlying component to the whole pivot thing, but I’m not sure how to invoke it to do anything like sorting the filter select list.
Any advice?