Skip to content

Commit

Permalink
Melhorias
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopaulichi committed Sep 28, 2018
1 parent b1811fc commit d5a0e03
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 7 deletions.
11 changes: 10 additions & 1 deletion build/softgrid.src.js
Expand Up @@ -1004,13 +1004,22 @@
_controlesParaColunas();

var _colunas = [];
var _limpar = false;

angular.forEach(_properties.cols, function(col){
_colunas.push(scope.cols.filter(function (item) { return removeAccents(item.title).replace(" ", "") === col.col; })[0]);
var _col = scope.cols.filter(function (item) { return removeAccents(item.title).replace(" ", "") === col.col; })[0];

if(_col)
_colunas.push(_col);
else
_limpar = true;
});

scope.sg_cols = _colunas;

if(_limpar)
scope.limparConfiguracaoColuna();

_getFilteredData();
}

Expand Down
11 changes: 10 additions & 1 deletion dist/softgrid.js
Expand Up @@ -1004,13 +1004,22 @@
_controlesParaColunas();

var _colunas = [];
var _limpar = false;

angular.forEach(_properties.cols, function(col){
_colunas.push(scope.cols.filter(function (item) { return removeAccents(item.title).replace(" ", "") === col.col; })[0]);
var _col = scope.cols.filter(function (item) { return removeAccents(item.title).replace(" ", "") === col.col; })[0];

if(_col)
_colunas.push(_col);
else
_limpar = true;
});

scope.sg_cols = _colunas;

if(_limpar)
scope.limparConfiguracaoColuna();

_getFilteredData();
}

Expand Down
2 changes: 1 addition & 1 deletion dist/softgrid.min.js

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions mock/app.js
Expand Up @@ -49,9 +49,8 @@ angular.module('todoApp', ['softgrid.directive','ngSanitize'])
{type: "checkbox", title: "Selecionar", callback: opa, item: "ativo" },
{title: "Nome", item: function(item){return item.nome}, edit: { item: "nome", function: _editar, width: "100%"}},
{title: "Cargo", item: function(item){return item.cargo}, align: "center", click: opa},
{title: "Telefone", item: function(item){return 0}, width: "100px", popOver: true},
{type: "select", title: "Status", item: 'status', data: dataSelect, field: { text: 'nome', value: 'id' },
callback: _callBackApprove},
{title: "Telefonete", item: function(item){return 0}, width: "100px", popOver: true},
{type: "select", title: "Status", item: 'status', data: dataSelect, field: { text: 'nome', value: 'id' }, callback: _callBackApprove},
{title: "Cargo A", default: false, item: function(item){return item.cargo + "A"}},
{title: "Cargo B", default: false, item: function(item){return item.cargo + "B"}},
{title: "Cargo C", default: false, item: function(item){return item.cargo + "C"}},
Expand Down
11 changes: 10 additions & 1 deletion src/softgrid.js
Expand Up @@ -1004,13 +1004,22 @@
_controlesParaColunas();

var _colunas = [];
var _limpar = false;

angular.forEach(_properties.cols, function(col){
_colunas.push(scope.cols.filter(function (item) { return removeAccents(item.title).replace(" ", "") === col.col; })[0]);
var _col = scope.cols.filter(function (item) { return removeAccents(item.title).replace(" ", "") === col.col; })[0];

if(_col)
_colunas.push(_col);
else
_limpar = true;
});

scope.sg_cols = _colunas;

if(_limpar)
scope.limparConfiguracaoColuna();

_getFilteredData();
}

Expand Down

0 comments on commit d5a0e03

Please sign in to comment.