简体   繁体   中英

YADCF for DataTables: Filter container could not be found

I'm trying to implement YADCF externally triggered column filter , however I get this error in my console:

ERROR: Filter container could not be found, columnObj.filter_container_selector: #external_filter_container_0
ERROR: Filter container could not be found, columnObj.filter_container_selector: #external_filter_container_1

two times in a row.

My JS looks like this:

var myTable = $('#seller-offers-table').DataTable();
yadcf.init(myTable, [
  {
    column_number: 0,
    filter_container_id: 'external_filter_container_0',
    filter_type: 'range_date'
  },
  {
    column_number: 1,
    filter_container_id: 'external_filter_container_1',
    filter_type: "auto_complete",
    text_data_delimiter: ","
  }
],{   externally_triggered: true} );

My DataTable DOM part looks like this:

dom: "<'row'<'col-sm-12'B>>" +
  "<'row'<'col-sm-12'tr>>" +
  "<'row'<'col-sm-5'l><'col-sm-7'p>>",

My DataTable populates correctly, no errors, however I do not see filtering fields. What I'm doing wrong here, please? I use YADCF v.0.9.3

So far I haven't implemented any specific filter related DIV since I understand that is automatically done by { externally_triggered: true }

Thank you.

ids that are specified in filter_container_id must be present in the html (its your responsibility to place them).

As to externally_triggered , when you set it to true you filters will invoke only when you manually will call yadcf.exFilterExternallyTriggered(table_arg)

please go over the docs and read each of the mentioned above features

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM