Viewing 15 replies - 1 through 15 (of 20 total)
  • Plugin Author Meitar

    (@meitar)

    query="select A" will do that.

    Thread Starter uculture

    (@uculture)

    thank you kindly =)

    Thread Starter uculture

    (@uculture)

    I query column A but then column B doesnt show.

    I would like the search box to look for only terms in column A

    Plugin Author Meitar

    (@meitar)

    I query column A but then column B doesnt show.

    I would like the search box to look for only terms in column A

    You’re confusing the Google API with the DataTables API.

    Use DataTables’s columns.searchable option to specify which columns to include in a DataTables search.

    Thread Starter uculture

    (@uculture)

    var table = $(‘#example’).DataTable();

    // #column3_search is a <input type=”text”> element
    $(‘#column3_search’).on( ‘keyup’, function () {
    table
    .columns( 3 )
    .search( this.value )
    .draw();
    } );

    I see that, but unsure how to taylor it to your plugin

    Plugin Author Meitar

    (@meitar)

    You want to use the datatables_columns attribute. From the FAQ:

    How do I change the default settings, like can I turn paging off? Can I change the page length? Can I change the sort order?

    All of these DataTables options are accessible through shortcode attributes. The shortcode attribute is an underscore-separated version of the DataTables’s CamelCase’ed option name, prefixed with datatables_.

    Since the option you’re looking for is a property set in the DataTables API’s columns object, you will need to write a JSON object in the datatables_columns attribute of the shortcode declaring the values for the properties of the DataTables API that you’re using.

    Thread Starter uculture

    (@uculture)

    wow, that is a large undertaking. Thank you though

    Thread Starter uculture

    (@uculture)

    $(‘#example’).dataTable( {
    “columnDefs”: [
    { “searchable”: false, “targets”: 0 }
    ]
    } );

    this one?

    Plugin Author Meitar

    (@meitar)

    that is a large undertaking.

    Not really…?

    No, it’s not as easy as point-and-click. And it probably should be, but I haven’t written that code yet. I probably won’t write that code for a long time because this is free software and very few people invest in it, y’know?

    Plugin Author Meitar

    (@meitar)

    I’ll show you an example:

    [gdoc key="ABCDEFG" datatables_column_defs='%5B { "searchable": false, "targets": 0 } %5D']

    This shortcode is the equivalent of the .dataTable() call you posted.

    Thread Starter uculture

    (@uculture)

    i tried something like this datatables_search_columns=”A”

    Thread Starter uculture

    (@uculture)

    http://www.lostshoebox.com/gazetteer-bavaria/

    I did try but it’s still not choosing only column A

    Plugin Author Meitar

    (@meitar)

    I did try but it’s still not choosing only column A

    That’s because datatables_column_defs='%5B { "searchable": false, "targets": 0 } %5D' makes column A (target 0) not searchable, as implied by "searchable": false, obviously. Read the friendly manual. I already linked you to it.

    Thread Starter uculture

    (@uculture)

    Ok, it’s making sense. I thank you kindly for your help =)

    thank you for the direction

    Thread Starter uculture

    (@uculture)

    would multiple targets looks like this?

    datatables_column_defs=’%5B { “searchable”: false, “targets”: 1, 2, 3, 4 } %5D’

Viewing 15 replies - 1 through 15 (of 20 total)

The topic ‘query only column 1’ is closed to new replies.