Primary Names begins with Lowercase letter

Primary Names begins with Lowercase letter

jdadwilsonjdadwilson Posts: 125Questions: 29Answers: 1

I have an instance of a dataTable where the primary column displays individual last names. Some names begin with a lowercase letter (i.e., deCordova). For the full list the names display as they should but if the 'D' Alpha letter is selected to filter the name those with 'deCordova' do not appear.

What can I do to ensure the 'deCordova' records appear when the Alpha letter 'D' is selected? Is this not doable?

James A Wilson
https://www.txgrayson.org/memorials/005/allison-cemetery

Answers

  • allanallan Posts: 62,858Questions: 1Answers: 10,344 Site admin

    That's a really old version of DataTables and the alphabet search plugin you've got there. The error you are seeing has been corrected in the latest versions, so you could update to recitfy the problem.

    Alternatively, if you want a quick patch, in your file https://www.txgrayson.org/java/functions_java/_alphabet_Search.js find:

    if (searchData[0].charAt(0) === context.alphabetSearch) {
    

    and change to be:

    if (searchData[0].charAt(0).toUpperCase() === context.alphabetSearch) {
    

    I think that should fix it.

    Allan

  • jdadwilsonjdadwilson Posts: 125Questions: 29Answers: 1

    Thanks much... that did solve the problem.

    I probably should update to the latest DataTables. But with almost 300 uses across 6 website it might be a very daunting task.

    Can you give me a clue as to how much effort an upgrade might take? Is it just a matter of a link to the latest version or will something be necessary on each instance.

    Thanks for a great product. As stated above I use it across almost every page on my websites.

    James A Wilson
    msholmes.org, txfannin.org, txgrayson.org

  • kthorngrenkthorngren Posts: 20,993Questions: 26Answers: 4,887
    edited June 13

    Here is the Upgrade guide. A few options, like deferRender, have changed defaults to look out for. Also refer to this post for more DT 2.0 info. As always it is best to use a test environment when doing a major version upgrade :smile:

    Kevin

  • jdadwilsonjdadwilson Posts: 125Questions: 29Answers: 1

    Kevin, I looked at the Upgrade Guide. I think the major problem with an upgrade is changing ~300 instances of DataTables using the DOM options to Layout options.

    Some questions about the Layout format.

    1. How is the Alpha Letter array indicated in the Layout?

    2. Given that some of the tables might have fewer rows than the PageLength min number, I have a routine that checks the number of rows against the PageLength value and if less, hides the items div.top and div.bottom areas. A routine on some pages also checks the PageLength to hide the Alpha letters. These functions are called in initComplete and drawCallback. I assume these could be updated for the layout options formatting.

    3. The Layout format seems to only allow for a single element or two with start and end elements. What about a layout with three elements? Yes, for larger viewports I do have a few the pageLength paging search. I assume these could be formatted using the single and double method by stacking. Which bring up another issue... could the three be stacked as double and single?

    If you look through one of my sites (msholmes.org, txfannin.org, txgrayson.org) you will notice that most of the pages use a DataTable. What you don't see is the admin area that uses a DataTable to assist volunteers in updating the 60+ mySql tables in the database.

    James A Wilson

    p.s., Don't let my photo fool you. It was taken in 1964.

  • allanallan Posts: 62,858Questions: 1Answers: 10,344 Site admin

    How is the Alpha Letter array indicated in the Layout?

    It isn't - it is replaced with something more understandable. For example B is buttons in layout.

    Given that some of the tables might have fewer rows than the PageLength min number, I have a routine that checks the number of rows against the PageLength value and if less, hides the items div.top and div.bottom areas.

    Most likely it will just need a class name to be updated - e.g. div.dt-length for the page length element now.

    The Layout format seems to only allow for a single element or two with start and end elements. What about a layout with three elements?

    I'm working on a solution for that for DataTables 2.1. It will be an array of elements for the top or bottom (i.e. I won't be introducing topCenter).

    Which bring up another issue... could the three be stacked as double and single?

    Yes, that is one of the benefits of the new layout - customisation like that is easier.

    It should be noted that dom isn't going away anytime soon. I have no immediate or medium term plans for DataTables 3 yet. It will continue to be fully supported in all 2.x releases.

    Allan

Sign In or Register to comment.