rawProcessorFxns.js
/* Compares all files in the specified table to a filter string and returns
 * an array of files that pass the filter
 * @param {string} filter The filter to be applied
 * @param {object} table The Webix table object ('view') to obtain the items from
 * @returns {Array} An array of file objects that passed the filter checks
 *                  Each element has the following properties: fileData, fileName, & ligID.          
 */
Compares all files in the specified table to a filter string and returns
an array of files that pass the filter
@param {string} filter The filter to be applied
@param {object} table The Webix table object ('view') to obtain the items from
@returns {Array} An array of file objects that passed the filter checks
Each element has the following properties: fileData, fileName, & ligID.
Compares all files in the specified table to a filter string and returns an array of files that pass the filter @param { string } filter The filter to be applied @param { object } table The Webix table object ( ' view ' ) to obtain the items from @returns { Array } An array of file objects that passed the filter checks Each element has the following properties : fileData fileName & ligID .
function filterRaw(filter, table){
   var filteredFiles = [];
   var filterArr = filter.split('.');
   var ligID;
   for(var tableIndex=0; tableIndex<table.count(); tableIndex++)
   {
      fID = table.getIdByIndex(tableIndex);
      fName = table.getItem(fID).fileName;
      fNameArr = fName.split('.');
      ligID = ''; 
      if (fNameArr.length == filterArr.length) {
         for(var arrIndex=0; arrIndex<filterArr.length; arrIndex++)
         {
            if (filterArr[arrIndex] == "[*]") {
               if (arrIndex+1 != filterArr.length)
                  continue; 
               else{
                  filteredFiles.push(table.getItem(fID));
                  continue;
               }
            }
            else if (filterArr[arrIndex] == "[ligID]") {
               var regex = /^\d{1,}$/;
               if(fNameArr[arrIndex].search(regex) == -1)
               {
                  console.log('File #'+tableIndex+' did not match');
                  break; 
               }
               else {
                  ligID = fNameArr[arrIndex];
                  continue;
               }
            }
            else if (filterArr[arrIndex] != fNameArr[arrIndex]) {
               console.log('File #'+tableIndex+' did not match');
               break; 
            }
            else if (filterArr[arrIndex] == fNameArr[arrIndex]) {
               if(arrIndex+1 != filterArr.length)
                  continue;
               else {
                  var item = table.getItem(fID);
                     item.ligID = ligID;
                  console.log('Match: file #'+tableIndex);
                  filteredFiles.push(item);
                  continue;
               }
            }
         }
      }
      fData = table.getItem(fID).fileData;
   }
   return filteredFiles;
}
function filterRaw ( filter , table ) { var filteredFiles = [ ] ; var filterArr = filter . split ( '.' ) ; var ligID ; for ( var tableIndex = 0 ; tableIndex < table . count ( ) ; tableIndex ++ ) { fID = table . getIdByIndex ( tableIndex ) ; fName = table . getItem ( fID ) . fileName ; fNameArr = fName . split ( '.' ) ; ligID = '' ; if ( fNameArr . length == filterArr . length ) { for ( var arrIndex = 0 ; arrIndex < filterArr . length ; arrIndex ++ ) { if ( filterArr [ arrIndex ] == "[*]" ) { if ( arrIndex + 1 != filterArr . length ) continue ; else { filteredFiles . push ( table . getItem ( fID ) ) ; continue ; } } else if ( filterArr [ arrIndex ] == "[ligID]" ) { var regex = / ^\d{1,}$ / ; if ( fNameArr [ arrIndex ] . search ( regex ) == - 1 ) { console . log ( 'File #' + tableIndex + ' did not match' ) ; break ; } else { ligID = fNameArr [ arrIndex ] ; continue ; } } else if ( filterArr [ arrIndex ] != fNameArr [ arrIndex ] ) { console . log ( 'File #' + tableIndex + ' did not match' ) ; break ; } else if ( filterArr [ arrIndex ] == fNameArr [ arrIndex ] ) { if ( arrIndex + 1 != filterArr . length ) continue ; else { var item = table . getItem ( fID ) ; item . ligID = ligID ; console . log ( 'Match: file #' + tableIndex ) ; filteredFiles . push ( item ) ; continue ; } } } } fData = table . getItem ( fID ) . fileData ; } return filteredFiles ; }
Compares all files in the specified table to a filter string and returns
 an array of files that pass the filter
 @param {string} filter The filter to be applied
 @param {object} table The Webix table object ('view') to obtain the items from
 @returns {Array} An array of file objects that passed the filter checks
                  Each element has the following properties: fileData, fileName, & ligID.
Compares all files in the specified table to a filter string and returns an array of files that pass the filter @param { string } filter The filter to be applied @param { object } table The Webix table object ( ' view ' ) to obtain the items from @returns { Array } An array of file objects that passed the filter checks Each element has the following properties : fileData fileName & ligID .
//clears the value from the previous loop run //Initial filter compares the number of '.' delimited elements //Compare each element of each array to each other //move onto next iteration //if (fNameArr[arrIndex] != 'number') //CAUSING ERROR: anything spliced from a string is a string by default //Match must start at string start until the string end; must only be digits //mismatch with filter: stop checking this file //mismatch: stop checking this file //Will only reach here if the name passes all filters //filteredFiles.push(table.getItem(fID));