1

I have tried every option I can think of in configuring both DataTables (capital D) and yadcf but cannot seem to get the select drop down list to list in case-insensitive order.

Setup:

      var dTable=$('#bTable').DataTable({
            "traditional": false,
            "pageLength": 1000,
            "jQueryUI": true,
            "stateSave": true,
            "stateDuration": 60 * 60 * 24,
            "processing": true,
            "stateLoadParams": function (settings, data) {
                lastSearch=data.search.search;
            },
            "ordering": true,
            "processing": true,
            "paging":   false,
            "info":     false,
            "autoWidth": false,
        })

        yadcf.init(dTable,[
            {column_number : 3, column_data_type: "text", filter_match_mode: "exact", sort_as: "alphaNum", filter_container_id: "hs_clu", filter_reset_button_text: false, style_class: "select-style", filter_default_label: "All"},
      ],
      { cumulative_filtering: true }
    );

When I click on the column header the column data is sorted properly as:

nbmps01
nbmps02
nbmps800
Network-1
Network-2
Network-3
NTPROV
NTSYM
NTWKTRANS
NVAM-CXMT

My dropdown select list is in this order and doesn't seem to be proper:

NTPROV
NTSYM
NTWKTRANS
NVAM-CXMT
Network-1
Network-2
Network-3
nbmps01
nbmps02
nbmps800

I have am at my wits end on this after 2 days of fiddling with it. Does anyone out there have any ideas and are willing to share.

Any help is very much appreciated.

M. White
  • 11
  • 1
  • Please provide a test case in your preferred js playground – Daniel Oct 16 '16 at 20:26
  • I have never played with js playgrounds before so I put one in jsfiddle but can't even make it pick up the datatables and yadcf script even though I added them under resources so I don't know how to do this. Here it is though... – M. White Oct 17 '16 at 02:52
  • https://jsfiddle.net/Mike_W/9c2y5v8b/6/ – M. White Oct 17 '16 at 02:52
  • Here is a very basic jsfiddle setup that using the latest yadcf : https://jsfiddle.net/6c660hat/11/ you can update it with your relevant code that reproduces the issue/s, dont forget to hit the Update button so a new fiddle will be created(updated url will be generated) then post – Daniel Oct 17 '16 at 20:06
  • I want to thank you Daniel for your patience with me in this endeavor... I have a jsfiddle that demonstrates the item. Col 3 is the area. If I click on Col3 it sorts the column correctly. When I click on the drop down above it the sort order is not case-in sensitive. Could it be the '-' in some of the data throwing the sort off? Thanks again. https://jsfiddle.net/Mike_W/6c660hat/42/ – M. White Oct 18 '16 at 00:57

1 Answers1

2

I have improved the alpha numeric sorting in yadcf 0.9.1.beta.5 , now it works as expected.

use sort_as: "alphaNum"

Here is a working jsfiddle link

Daniel
  • 36,833
  • 10
  • 119
  • 200
  • Thanks Daniel.... I really like this yadcf libray. You have done terrific job with it. – M. White Oct 18 '16 at 20:57
  • Someone should up vote this answer. I tried but apparently don't have enough "reputation" yet... ( I don't know if that's a good thing or bad... :-) ) – M. White Oct 18 '16 at 21:00