Gesher Galicia - support question

Gesher Galicia - support question

allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
edited June 2009 in General
Hi Allan (and others),

I'm using DataTables on a genealogy website, to display information about certain old records and maps that are held in a library in Ukraine:

http://www.jewishgen.org/galicia/cadastral_maps_and_landowners_project/records.php

I'm going to be using DataTables a lot more in the coming months, to turn various .XLS/.CSV files into searchable database-like presentations for the web (without actually turning them into mySQL databases unless it's really needed). So, your plugin will be helping researchers and genealogists search through old vital record data from the former Austro-Hungarian Empire.

Actually, as long as I'm posting in the forums here, may I trouble you for a small support question? On the webpage that I posted, see the link that says "Click here to learn how to show ONLY those maps and lists that have been ACQUIRED" on the top right side of the page? See how I'm filtering the table results based on certain TD class names -- using CSS show/hide, and not a native function in DataTables? And see how I don't know how to refresh the table afterwards without forcing the user to do a hard refresh in their browser? There *must* be a better way to handle all that -- any ideas?

Thanks. :-)


Allan: Moved from the "how do you use" thread to a separate thread to keep support questions out of the other one :-)

Replies

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    Hi Asparagirl,

    Is there any reason you are using the DataTables filtering options for doing what you are? There are a couple of options, raging from relatively simple to complex!

    1. You could have a hidden column with this information and then call "fnFilter()" for that column to filter by ACQUIRED etc.
    2. You could use the filtering API to search for nodes with your class names.
    3. An empty "" with the required class name and you can fnFilter() on that.

    And probably other options that I can't think of off the top of my head... Any of these methods would let you then remove the filter and have the original table restored without a refresh.

    Regards,
    Allan
  • AsparagirlAsparagirl Posts: 4Questions: 0Answers: 0
    Hi Allan,

    Yes, we need to keep the class names attached to the TR (as opposed to creating a hidden column and searching on that) because we need to show a visual identifier, such as bolding and text color change, for that whole row based on the status of that particular map or text. So it looks like option #1 is not possible. Option #3 would probably work, but I would like to stay away from adding extra mark-up to the table if possible. So, Option #2 sounds like our best bet.

    Could you -- or anyone else reading this post -- please help me figure out to how to use the filtering API to search for nodes with class names? Thanks so much.


    - Brooke
  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    Hi Brooke,

    I certainly can (and I'm sure others could as well!). Have a look at this example for custom filtering: http://datatables.net/1.5-beta/examples/api/range_filtering.html . It shows range filtering, but you will be able to see that you have the DOM element to work with, so you can quickly look at the TRs class name, and decide if you want to keep that row or not.

    How does that sound?
    Allan
This discussion has been closed.