Skipping (ignoring) a column? And changing column order?

Skipping (ignoring) a column? And changing column order?

neveznevez Posts: 1Questions: 0Answers: 0
edited July 2009 in General
Hello,

does anybody know if there is there a way to make datatables completely ignore a column of the data source (so that it is not rendered in the html at all, as if it wasn't present in the dataset)?

furthermore, is there a way to alter the column display order?

Thank you

Replies

  • squigsquig Posts: 14Questions: 0Answers: 0
    Hi nevez,

    you can hide columns by configuration as shown in the following example:
    http://datatables.net/examples/example_hidden_columns.html


    squig
  • allanallan Posts: 61,812Questions: 1Answers: 10,122 Site admin
    Hi nevez,

    Regarding your question about reordering columns. This isn't currently possible (well - it's possible but I don't have the code for it). I have been working on an API function for exactly this, but its really not all the trivial to do, and I've been getting somewhat distracted from it recently. It's on the old to do list after 1.5 is released though.

    Regards,
    Allan
  • jaredcrossleyjaredcrossley Posts: 8Questions: 0Answers: 0
    Hi Allan,

    Has any progress been made on column reordering? I'd like to allow my users to reorder columns as they like.

    I have not used server-side processing, but I'm wondering if parameter sName could be used to this effect?

    Many thanks,

    Jared
  • allanallan Posts: 61,812Questions: 1Answers: 10,122 Site admin
    Hi Jared,

    I'm afraid I've not managed to make much head way on this recently - most of the time I have available for DataTables development is spent doing support at the moment. But when I get 1.5.3 out, I'll try and bump this up the priority scale on the to-do list :-)

    Regarding sName - it might be useful to know which column is where, but I don't think it will help too much, unless are are doing server-side processing and reorder the column there (some callback would be needed to modify the header as well).

    Regards,
    Allan
  • jaredcrossleyjaredcrossley Posts: 8Questions: 0Answers: 0
    In anticipation of a future DataTables column-reordering feature, I want to pass this along for interested developers.

    The app linked below has a very nice user interface for dynamically reordering and hiding table columns. I've found the code for this app difficult to understand, but the column manipulation part of the UI is quite nifty I think. Notice that the "Columns" sub-table allows individual columns to be moved in the main table, and, in addition, contains a "Columns below are hidden" slide-bar that hides all columns below it.

    The easiest way to see the application in action is to follow this link, enter something (like "crab") in the position field, and click "Submit Query".

    http://heasarc.gsfc.nasa.gov/vo/squery/?IVOID=ivo://archive.stsci.edu/hst/stis&type=cone

    Then check out the "Columns" table at the bottom.

    For the record, the name of this app is VOView, and it was created as part of the National Virtual Observatory. I can post a link to source code if anyone is interested.

    Hope it stimulates your creative juices!

    Jared
This discussion has been closed.