1. Let’s start by creating the popup
  1. Rename new window
  1. Definitely we should arrange this new space. Start with a new List Box
  1. Add tree new buttons: UP, DOWN, Save and Close
  1. Change style on List Box to add borders
  1. Rename new elements
  1. Create a new button on the Canvas
  1. Create a script variable
  1. Change name and set as array
  1. Create onClick event for the new - Change Layout button
// Get current dimensions
var currentDimensions = Table_Games_Sales.getDimensionsOnRows();
// Assign values to the global variable
ScriptVariable_Dimensions_Values = Table_Games_Sales.getDimensionsOnRows();

// Clear the current list
ListBox_Dimensions_Order.removeAllItems();
// Add current dimensions to the list
for ( var i = 0; i < currentDimensions.length; i++ ){
	ListBox_Dimensions_Order.addItem(currentDimensions[i]);
}
// Open popup
Popup_Dimensions_Order.open();
  1. Add code for Button_Save_And_close - onClick
    // Get all current dimensions
    var allDimensions = Table_Games_Sales.getDimensionsOnRows();
    // Delete all dimensions
    for (var i = 0; i < allDimensions.length; i++){
    	Table_Games_Sales.removeDimension(allDimensions[i]);
    }
    // Set new dimensions
    for (var r = 0; r < ScriptVariable_Dimensions_Values.length; r++){
    	Table_Games_Sales.addDimensionToRows(ScriptVariable_Dimensions_Values[r]);
    }
    // Close popup
    Popup_Dimensions_Order.close();
  1. Add code for Button_Down - onClick
    // Get all selected Keys
    var selectedValue = ListBox_Dimensions_Order.getSelectedKey();
    // Change the order on the list and update List Box
    if (selectedValue){
    	var valueIndex  = ScriptVariable_Dimensions_Values.indexOf(selectedValue);
    	ScriptVariable_Dimensions_Values.splice(valueIndex,1);
    	ScriptVariable_Dimensions_Values.splice(  valueIndex + 1,0, selectedValue );
    	ListBox_Dimensions_Order.removeAllItems();
    
    	for ( var i = 0; i < ScriptVariable_Dimensions_Values.length; i++){
    		ListBox_Dimensions_Order.addItem(ScriptVariable_Dimensions_Values[i]);
    	}
    }
  1. Add code for Button_Up - onClick
    // Get all selected Keys
    var selectedValue = ListBox_Dimensions_Order.getSelectedKey();
    // Change the order on the list and update List Box
    if (selectedValue){
    	var valueIndex  = ScriptVariable_Dimensions_Values.indexOf(selectedValue);
    	ScriptVariable_Dimensions_Values.splice(valueIndex,1);
    	ScriptVariable_Dimensions_Values.splice(  valueIndex - 1,0, selectedValue );
    	ListBox_Dimensions_Order.removeAllItems();
    
    	for ( var i = 0; i < ScriptVariable_Dimensions_Values.length; i++){
    		ListBox_Dimensions_Order.addItem(ScriptVariable_Dimensions_Values[i]);
    	}
    }
  1. At the end we have a complete and working solution. Congratulations šŸ¾ !