vendredi 15 janvier 2016

Ember Bootstrap plugin

I am using the Bootstrap Table plugin with Ember. When I execute the following code it works:

HBS

<table id="table" class="header-fixed"></table>
<script type="text/javascript">
  $('#table').bootstrapTable({{jsonHelper table}});
</script>

But I am trying to move all my javascript out of the temmplate and into the javascript file. The following does not work:

HBS

<table id="table" class="header-fixed"></table>

JS

didInsertElement: function() {
  this.$('#table').bootstrapTable(this.get('table'));
}

I receive the following error: Uncaught TypeError: this.$(...).bootstrapTable is not a function.

I have the following in my ember-cli-build.js:

app.import('bower_components/jquery/dist/jquery.min.js');
app.import('bower_components/bootstrap/dist/css/bootstrap.min.css');
app.import('bower_components/bootstrap/dist/js/bootstrap.min.js');
app.import('bower_components/bootstrap-table/dist/bootstrap-table.min.css');
app.import('bower_components/bootstrap-table/dist/bootstrap-table.min.js');

So it should be importing bootstrapTable. It clearly is importing because it works when I execute the command from the template file. Any help is greatly appreciated.




Aucun commentaire:

Enregistrer un commentaire