query only column 1
-
Is this possible to query only column 1?
https://ww.wp.xz.cn/plugins/inline-google-spreadsheet-viewer/
-
query="select A"will do that.thank you kindly =)
I query column A but then column B doesnt show.
I would like the search box to look for only terms in column A
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.searchableoption to specify which columns to include in a DataTables search.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
You want to use the
datatables_columnsattribute. 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
columnsobject, you will need to write a JSON object in thedatatables_columnsattribute of the shortcode declaring the values for the properties of the DataTables API that you’re using.wow, that is a large undertaking. Thank you though
$(‘#example’).dataTable( {
“columnDefs”: [
{ “searchable”: false, “targets”: 0 }
]
} );this one?
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?
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.i tried something like this datatables_search_columns=”A”
http://www.lostshoebox.com/gazetteer-bavaria/
I did try but it’s still not choosing only column A
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.Ok, it’s making sense. I thank you kindly for your help =)
thank you for the direction
would multiple targets looks like this?
datatables_column_defs=’%5B { “searchable”: false, “targets”: 1, 2, 3, 4 } %5D’
The topic ‘query only column 1’ is closed to new replies.