Closed RitchieD closed 10 years ago
@RitchieD You would need to replace $elm with a jQuery object reference to the table. So if the id on the table is "mytable", then you could use $( "#mytable" ).( "wb-init.wb-tables" );
. You could also cache the reference to $elm (e.g., $elm = $( "#mytable" );
) and then use the line of code from the documentation.
Looks like the document is using the wrong event (for inview not table), but this should probably be discussed in core not the styleguide.
@nschonni Thanks for catching the wb-inview (just copied and pasted). I've updated my response. And yes, this discussion would be more appropriate in wet-boew/wet-boew.
Thanks. Here is my final working code:
<script type='text/javascript'>
$elm = $('#tableCases')
$elm.trigger( 'wb-init.wb-tables' );
</script>
How do you manually initialize the table plug-in?
I have a page that uses ajax to return a result table. The main page does not have a table. So I need to manually initialize the table.
Documentation is unclear. http://wet-boew.github.io/v4.0-ci/docs/ref/tables/tables-en.html
The following fails to find $elm $elm.trigger( “wb-init.wb-inview” );
The following line does nothing. $(document).trigger("wb-init.wb-tables");
This line doesn’t find “dataTable()”. $(document).ready(function () { $('#mytableid').dataTable(); });
WET v4.0