update variables slickgrid table row ids
This closes
return false;
};
+ var variablesCount = 0;
+
/**
* Loads the specified variable registry.
*
*/
var loadVariables = function (variableRegistry, variableToSelect) {
if (nfCommon.isDefinedAndNotNull(variableRegistry)) {
- var count = 0;
var index = 0;
var variableGrid = $('#variable-registry-table').data('gridInstance');
$.each(variableRegistry.variables, function (i, variableEntity) {
var variable = variableEntity.variable;
variables.push({
- id: count++,
+ id: variablesCount++,
hidden: false,
canWrite: variableEntity.canWrite,
name: variable.name,
if (matchingVariable === null) {
// add a row for the new variable
- var id = variableData.getLength();
variableData.addItem({
- id: id,
+ id: variablesCount,
hidden: false,
canWrite: true,
name: variableName,
variableData.reSort();
// select the new variable row
- var row = variableData.getRowById(id);
+ var row = variableData.getRowById(variablesCount);
variableGrid.setActiveCell(row, variableGrid.getColumnIndex('value'));
variableGrid.editActiveCell();
+ variablesCount++
} else {
// if this row is currently hidden, clear the value and show it
if (matchingVariable.hidden === true) {
