Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #2296 from jamessspanggg/add-filldown-blankdown-fo…
Browse files Browse the repository at this point in the history
…r-all

[#2280] Add fill down and blank down operations for all columns
  • Loading branch information
wetneb committed Jan 27, 2020
2 parents fe14732 + a19f859 commit 5894041
Showing 1 changed file with 55 additions and 0 deletions.
Expand Up @@ -794,6 +794,17 @@ DataTableView.prototype._createMenuForAllColumns = function(elmt) {
click: function() {
new ColumnReorderingDialog();
}
},
{},
{
label: $.i18n('core-views/fill-down'),
id: "core/fill-down",
click: doAllFillDown
},
{
label: $.i18n('core-views/blank-down'),
id: "core/blank-down",
click: doAllBlankDown
}
]
},
Expand Down Expand Up @@ -897,6 +908,50 @@ DataTableView.prototype._createSortingMenu = function(elmt) {
MenuSystem.createAndShowStandardMenu(items, elmt, { horizontal: false });
};

var doAllFillDown = function() {
doFillDown(theProject.columnModel.columns.length - 1);
};

var doFillDown = function(colIndex) {
if (colIndex >= 0) {
Refine.postCoreProcess(
"fill-down",
{
columnName: theProject.columnModel.columns[colIndex].name
},
null,
{modelsChanged: true},
{
onDone: function() {
doFillDown(--colIndex);
}
}
);
}
};

var doAllBlankDown = function() {
doBlankDown(0);
};

var doBlankDown = function(colIndex) {
if (colIndex < theProject.columnModel.columns.length) {
Refine.postCoreProcess(
"blank-down",
{
columnName: theProject.columnModel.columns[colIndex].name
},
null,
{ modelsChanged: true },
{
onDone: function() {
doBlankDown(++colIndex);
}
}
);
}
};


DataTableView.prototype._updateCell = function(rowIndex, cellIndex, cell) {
var rows = theProject.rowModel.rows;
Expand Down

0 comments on commit 5894041

Please sign in to comment.