Comments (18)
Make sure to include jQuery and lodash in your index.html - it seems that md-data-table relies on these two libraries.
I added these two lines to my code and the table worked
<script src="https://code.jquery.com/jquery-2.1.4.js"> </script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js"> </script>
from mddatatable.
I ran into the same issue, however if you include jquery before angular it works fine. If you are using bower_concat just add jquery as a dependency to angular.
like this:
dependencies: {'angular':['jquery']},
from mddatatable.
Hi Samster, you're welcome, however still a lot to do with the project.
I think u missed wrapping the md-data-table-column with md-data-table-header-row.
Can you please make a screenshot or copy your code and show me?
from mddatatable.
I'm using the example code you had on your README as shown below. My project is for work, so I'm unable to give you more of the source.
Could it have anything to do with the way bower is pulling in the library or the way I'm minifying using gulp etc? It's just weird that it recognizes the md-data-table-column directive but then can't find the parent controller.
I'm not sure if it has anything to do with it, but I have an Angular project following the general structure outlined by John Papa's style guidelines. In particular, I'm using ui-router, and "controller as" syntax etc.
Thanks for the help!
<md-data-table
selectable-rows="true"
table-card="{title: Nutrition, actionIcons: true}">
<md-data-table-header-row>
<!-- defining column descriptions, align content to the left -->
<md-data-table-column
align-rule="left"
column-definition="The total amount of food energy in the given serving size.">
Dessert (100g serving)
</md-data-table-column>
<!-- in case of inline menu -->
<md-data-table-column inline-menu="[ {iceCream: 'Ice Cream', pastry: 'Pastry', other: 'Other'} ]">Type</md-data-table-column>
<!-- inline text editing -->
<md-data-table-column editable-field="textInput">
Calories
</md-data-table-column>
<!-- in case of sortable columns, we can set the defaultly sortable column -->
<md-data-table-column sortable-rows-default>
Fat (g)
</md-data-table-column>
<md-data-table-column>Carbs (g)</md-data-table-column>
<md-data-table-column>Protein (g)</md-data-table-column>
</md-data-table-header-row>
<md-data-table-row ng-repeat="nutrition in nutritionList">
<md-data-table-cell>Frozen Joghurt</md-data-table-cell>
<md-data-table-cell>159</md-data-table-cell>
<md-data-table-cell>6</md-data-table-cell>
<md-data-table-cell>24</md-data-table-cell>
<md-data-table-cell>4</md-data-table-cell>
<md-data-table-cell>87</md-data-table-cell>
</md-data-table-row>
</md-data-table>
from mddatatable.
Hi!
Thanks for this module, it looks fantastic however I'm having the exact same issue as samster here, my simple table looks like this:
<md-data-table
table-card="{visible: true, title: 'Users'}"
selectable-rows="true"
sortable-columns="true">
<md-data-table-header-row>
<md-data-table-column>User Name</md-data-table-column>
<md-data-table-column>Role</md-data-table-column>
</md-data-table-header-row>
<md-data-table-row ng-repeat="user in users | orderBy: 'role'">
<md-data-table-cell>{{user.username}}</md-data-table-cell>
<md-data-table-cell>{{user.role}}</md-data-table-cell>
</md-data-table-row>
</md-data-table>
Any help would be appreciated
from mddatatable.
I'm having the same issue, and after a lot of trial and error I have been able to reproduce it by simply removing the reference to jquery from the demo app. This implies there is a dependency on jquery, but I couldn't figure out why.
Maybe one of the calls to angular.element isn't supported by jqlite? Is that really necessary?
from mddatatable.
FYI: Working on the issue, give me 1 day and it will be solved.
from mddatatable.
Sorry guys. Today I'll have a look at it.
from mddatatable.
@samster @joansanfeliu @samchristie
I cannot reproduce the issue. For me it was working locally.
Can somebody provide me a demo plunkr where I can spot the error?
Thanks.
from mddatatable.
Tried to create a sample app to reproduce. Hope it helps.
from mddatatable.
Thanks for looking into this. I have been able to recreate it many times but only in a very complex application. I'll see what I can do with the sample app you created. Thanks a lot.
Sam Christie
Sent from 919-272-1368
Tried to create a sample app to reproduce. Hope it helps.
Reply to this email directly or view it on GitHub:
#24 (comment)
from mddatatable.
I was having this same issue as well. We use jade and compile to HTML and I discovered that this issue appeared when everything was not nested correctly. For example, your md-data-table-header-row and md-data-table-row elements need to all be a child of md-data-table. While this seems obvious, in our case, jade made it less obvious. As soon as we fixed this, our errors went away and it functions as expected.
from mddatatable.
Good to hear that. But the others unfortunately had the right structure but it's not working for some reason. I'm did some investigations but I didn't find the cause. I'd be glad if someone of you guys can help me with that issue. Pull requests are welcome here as well.
from mddatatable.
I ran into the same issue.
I come to the same conclusion as samchristie: from this plunker http://plnkr.co/GhIJYp23Y3XqLAKzqSiL, just comment out the jquery script tag in index.html to reproduce the error.
from mddatatable.
@samster Is that solved your issue?
from mddatatable.
+1
from mddatatable.
Add jquery on top of script it will work
from mddatatable.
Fixes also electron with v1.8.1
from mddatatable.
Related Issues (20)
- How to add custom icon/button in table card?
- Table becomes so slow when using http.get to get the data in a json file HOT 1
- Virtual Repeat is not working in ajax case
- Dependency required to added manually ( angular-sanitize, lodash) HOT 2
- template files 404s HOT 1
- Clicking on headers works even if pointer is not near header text.
- Error loading data,How can i debug the error?
- rowId didn't change when i delete some row from my data
- Need to add a PLUS icon on table card for adding a row in mdt-table. HOT 1
- how to add more options in selectablerowcallback
- Headers not appearing in data table. HOT 3
- Truncate md-cell for long text values without increasing row height
- column filters not filtering anything. HOT 1
- In Paginator Callback function, offset changed to NaN and won't load table.
- Access Json Object of selected columns - columnSelector
- XSS vulnerability
- Md-checkbox disappears when clicked
- combining the table card with the table header?
- Merging cells in adjacent columns
- Example of a suitable comparator?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mddatatable.