mdArrayEngine: Javascript Array Class
mdArrayEngine: A free to use Javascript class for multi dimension array creation and manipulation
Although this class is not all encompassing by any means, it should assist assist you with any Javascript projects incorporating multi dimensional array use. Should you wish to add or extend the class, please feel free to do so. If you feel that others could benefit from your work, please include a message below and I will include your additions to the base class as appropriate.
How to Instantiate:
1. Include the file md_arr_engine.js in your project.
2. in your javascript, instantiate the array class in the following manner:
var a = new mdArrayEngine();
List of mdArrayEngine functions:
init(): to initialize the class array
getLength(): to return the length of the array
getRowLength(row = [int]): to return the length of the array’s row
push(v = [mixed var]): push string or array of values onto the end of the array
rowPush(searchValue = [mixed var], addValues = [array]): Add array items to an existing row where the searchValue matches
indexOfValue(v = [mixed value]): to return the array indices of the value in the array
getValue(iRow=[int], iCol=[int]): To return a value from the array matching the supplied row and column numbers.
setValue(iRow = [int],iCol = [int], data = [mixed var]): To assign a value to the array matching the supplied row and column numbers.
getRow(iRow=[int]): To return a row from the array matching the supplied row number
getAllValues(): To return the entire contents of the array as an array.
updateItem(searchVal = [mixed var], replaceVal = [mixed var]): To enable a singular search and replace in the array
upadteRow(searchVal = [mixed var], replaceVal = [mixed var]): To enable a row replace in the array based on the searchVal parameter.
deleteRow(row =[int]): Delete the row number corresponding to the row variable.
updateRow_DualCondition(condition1 = [mixed var], condition1 = [mixed var], updateData = [array]): updates differences in matching row with data from updateData or inserts a new row if no match found on search condition1 & condition2 Returns true for success, false for failure
column_Arithmetic_Sum_SingleCondition(conditionalColumn = [int], value = [mixed var], columnToAdd = [int]): To sum the values of the columnToAdd WHERE conditionalColumn = x AND conditionalColumn value = y.
arrayDump(): To display the entire contents of the array as an html table.

