Git Product home page Git Product logo

backbone.datagrid's People

Contributors

franckverrot avatar gtzoganis avatar loicfrering avatar sdeleuze avatar shagi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

backbone.datagrid's Issues

actionClassName callback is not passed the corresponding model.

Hi,

Thanks for this component, it is very useful.

I have encountered a case that seems like a bug. In your documentation I read:
"cellClassName (string|callback)

The class name of the cell (td or th). It can be a string or a callback which will be passed the model related to the current row. "

Since there is no specific documentation for an actionClassName that is defined for a view of type ActionCell, I tried to follow the above and assign a function to it that is passed the row model. That did not work.

I have fixed it by editing the source code of Backbone.Datagrid, and replacing the lines
if (this.options.actionClassName) {
a.addClass(this.options.actionClassName);
}
with
if (this.options.actionClassName) {
var actionClassName = this.options.actionClassName;
if (_.isFunction(actionClassName)) {
actionClassName = actionClassName(this.model);
}
a.addClass(actionClassName);
}

It is working ok. I wonder if you think you can include it in a next release of Backbone.Datagrid?

error when paginating

Empty datagrid

Manage empty datagrid with a nice configurable message.

Incompatibility with Backbone 1.0: Not re-rendering the grid when sorting using a Server API

Hi,

I am using a remote API to fetch my collections from, and after upgrading Backbone to version 1.0, sorting did no longer work. This is because collection#fetch() does not trigger a 'reset' event by default any more.

I have fixed this locally by adding the reset:true property in the options object, in the _request funcion of Backbone.Datagrid, but I wonder if this is the best approach? If you think this is fine I would happily open a pull request.

Thanks,
Gerasimos

Underscore bind function on columns view

Hi,
On a Backbone view, when i init my DataGrid and set the view with a function using an underscore bind like this:

this.statsGrid = new DataGrid({
                          .....
            columns: [{
                title: PageLocalizing.grid.columnsLabels.skill,
                property: 'level, processingType',
                view: _.bind(function(model) {
                    return this.getProfile(model.level, model.processingType);
                }, this ),
                sortable: true
                }
                }
            ]
            });

this don't works but if i use Jquery proxy method :

this.statsGrid = new DataGrid({
                          .....
            columns: [{
                title: PageLocalizing.grid.columnsLabels.skill,
                property: 'level, processingType',
                view: $.proxy(function(model) {
                    return this.getProfile(model.level, model.processingType);
                }, this ),
                sortable: true
                }
                }
            ]
            });

It's works

Not compatible with backbone 1.1.0

Backbone version: 1.1.0
Underscore vs: 1.5.2
RequireJS version: 2.1.9
Google Chrome: 32.0.1700.76 m

I had to change a bunch of lines where the options are not passed as parameter to the initialize function to some views (almost all of them). Is this project still being supported?

Example:
From:

var Header = Datagrid.Header = Backbone.View.extend({
  tagName: 'thead',

  initialize: function() {
    this.columns = options.columns;
    this.sorter  = options.sorter;
  },

to:

    var Header = Datagrid.Header = Backbone.View.extend({
      tagName: 'thead',

  initialize: function(options) {
    this.columns = options.columns;
    this.sorter  = options.sorter;
  },

And this happens on every view definition.

The sorting is not working too.

I'm using it on a requirejs setup, included as a shim.

Passing sort options at initialization

It could be interesting passing sort parameters at datagrid initialization. Actually, it works by rendering the datagrid, hence doing a server query, then activate a sort that does another query.
Passing a kind of sort parameters at initialization time would be nice to avoid this useless query

Update pagination html markup to correspond to Bootstrap 3

Hi,

Although nowhere referenced in the readme, it seems to me that the generated html follows the bootstrap directives. I was using Bootstrap 2.3.2 in my project and it was working fine.

However, the html produced for the pagination controls in no longer works in Bootstrap 3. Specifically, the pagination classname should be assigned to the <ul> itself, not the surrounding div. To center the pagination controls you could simply add the text-center class in the surrounding div.

Is upgrading this part of Backbone Datagrid something you would consider?

Should use listenTo() instead of on()

In order to cleanup correctly event listeners when destroyed
Should specify that Backbone 0.9.10 or > is needed

Should be great to have this in 0.2.1 for Backbone RESThub stack 2.1 ;-)

when add a model to collection, the grid don't get update.

in my web app, i create a new model and insert it to the colletion(use collection.push , collection.unshift or collection.add), but the grid seems dont get update.

i read the source code, found the grid only listening on 'reset' event.

bug : display after remote sort

When using a remote collection, when sorting data :

  • the arguments are passed to the REST webservice
  • the REST webservice returns the records sorted
  • but the datagrid displays records in random order, not in the order the REST webservice returned them...

(Tested with datagrid v0.3.2)

Pagination issue

Hi,

I have really big data to be send to the datagrid and I display them per 50 in each page. My problem is that I have "<< 1 2 3 ... 40 >>" and this is taking more than a line and getting ugly on my page.

Do you already have a solution to have "<< ... 25 26 ... >>" instead for example or any idea about how doing it ?

Thank you

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.