Coder Social home page Coder Social logo

radireddy / ember-bootstrap-table Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 0.0 498 KB

Ember component for bootstrap table with (in memory and server side) sorting, filtering, pagination and row selection.

License: MIT License

JavaScript 83.27% CSS 3.53% HTML 13.20%

ember-bootstrap-table's People

Contributors

radireddy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ember-bootstrap-table's Issues

eb-table.js:29 Uncaught TypeError: Cannot read property 'then' of undefined

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;
                }
            }
        }),

Error loading the component

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

Customized actions in a column generates error

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);
        }
    }
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.