Skip to content

Instantly share code, notes, and snippets.

@marti1125
Last active December 30, 2015 21:09
Show Gist options
  • Save marti1125/7885287 to your computer and use it in GitHub Desktop.
Save marti1125/7885287 to your computer and use it in GitHub Desktop.
cell
{
name: "rechazo",
label: "Rechazos",
editable: false,
cell: Backgrid.Cell.extend({
render: function () {
if(this.model.attributes['rechazos'] > 0) {
this.$el.html('<a class="botonrechazo-centro-periodo" data-id="' + this.model.attributes['id'] + '" role=button href="#modalAccionesCPRechazos" data-toggle="modal"><button class="btn">Historial de Rechazos ('+ this.model.attributes['rechazos'] +')</button></a>');
} else {
this.$el.html('<button class="btn" disabled>Historial de Rechazos ('+this.model.attributes['rechazos']+')</button>');
}
return this;
}
})
},
//another
var collectionnn = collectionCentroPeriodoDto.models;
_.each(collectionnn, function (model) {
model.set({rechazo: 1});
});
@wyuenho
Copy link

wyuenho commented Dec 10, 2013

change:rechazo will be automatically listened to when you construct the cell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment