radireddy / ember-bootstrap-table Goto Github PK
View Code? Open in Web Editor NEWEmber component for bootstrap table with (in memory and server side) sorting, filtering, pagination and row selection.
License: MIT License
Ember component for bootstrap table with (in memory and server side) sorting, filtering, pagination and row selection.
License: MIT License
I tried using ember-bootstrap-table but I got this error. In the template I did as follows:
<div>
{{#eb-table
pageSize=10
content=users
columns=columns}}
{{/eb-table}}
</div>
In the component :
export default Ember.Component.extend({
columns: Ember.computed(function() {
var col1 = ColumnDefinition.create({
header: 'Full Name',
isSortable: false,
contentPath: this.get('spreadsheetColumns')[0],
isFilterable: true
});
var col2 = ColumnDefinition.create({
header: 'Language',
isSortable: false,
contentPath: this.get('spreadsheetColumns')[1],
isFilterable: true
});
var col3 = ColumnDefinition.create({
header: 'Login',
isSortable: false,
contentPath: this.get('spreadsheetColumns')[2],
textAlign: 'center',
isFilterable: true
});
return [col1, col2, col3];
}),
});
And I get the error from eb-table.js
_resolvedContent: _ember['default'].computed('content', function (key, value) {
if (arguments.length > 1) {
return value;
} else {
var _this = this;
value = _ember['default'].A();
var content = this.get('content');
if (content.then) { // Error on this line
// content is a promise
content.then(function (resolvedContent) {
// when the promise resolves, set this property so it gets cached
set(_this, '_resolvedContent', resolvedContent);
set(_this, 'content', resolvedContent);
//console.log(content._results);
// if the promise resolves immediately, set `value` so we return
// the resolved value and not []
//value = resolvedContent;
set(_this, '_isLoading', false);
});
// returns [] if the promise doesn't resolve immediately, or
// the resolved value if it's ready
return value;
} else {
// content is not a promise
set(this, '_isLoading', false);
return content;
}
}
}),
If the pageSize=0
then do not display the pagination footer.
Getting below error after including this component in my template
"ember.debug.js:39859 Uncaught Error: Cannot call compile
without the template compiler loaded. Please load ember-template-compiler.js
prior to calling compile
."
I have installed ember-template-compiler.js already. Is there anything else thats missing ?
Update: My mistake. Didn't do app import as mentioned in the install instructions. Please close the issue.
Thanks
I am unable to display data in the HTML. When I checked through firebug, I got this error "TypeError: _ember.default.HTMLBars.compile is not a function".
Please help me resolve the issue!
Thank you!
When using the code below to create customized actions in a column you get the following error:
Assertion Failed: You must either provide a contentPath or override getCellContent in your column definition
This code is taken straight from the examples in the readme.
export default Ember.Controller.extend({
columns: Ember.computed(function() {
var col4 = ColumnDefinition.create({
header: 'Action',
isSortable: false,
contentPath: '',
textAlign: 'center',
isFilterable: false,
columnComponentName: 'users-table-delete-column',
});
return [col1, col2, col3, col4];
})
});
//users-table-delete-column.js
import Ember from 'ember';
import VcaTableColumn from 'ember-bootstrap-table/components/eb-table-column';
const { getOwner } = Ember;
export default VcaTableColumn.extend({
layout: Ember.HTMLBars.compile('<button type="button" class="btn btn-primary btn-sm" id="delete" {{action "deleteRow" row target="controller"}}> Delete </button>'),
actions: {
deleteRow: function(row) {
console.log(row);
getOwner(this).lookup('controller:table').send('deleteUser', row);
}
}
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.