ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

Upgraded from RC18 to RC21, am getting 'processor: undefined' for several existing grids

Open tedhohio opened this issue 11 years ago • 8 comments

Getting this error message when trying to view fairly complicated grids (filter, selection, exporting, pagination, context menus . . .): "Error: processor is undefined startProcessor@http://localhost:8085/DISCUS-NG-Server/resources/ui-grid/ui-grid.js:4291:7'

No error in web console log for fairly vanilla grids (filtering, pagination)

tedhohio avatar May 01 '15 19:05 tedhohio

Are you able to tell us what is actually at that line in ui-grid.js (it depends on exactly which build you're using). The function name and module would be useful, along with the line of code.

Even more helpful would be a plunker that demonstrates the issue so we can debug.

PaulL1 avatar May 16 '15 01:05 PaulL1

Using ui-grid - v3.0.0-rc.19 - 2015-02-11, location within ui-grid is the startProcessor function (line 4291). I don't have a plunker for it right now, I'll try and get to one over the weekend.

What I did was swap out the ui-grid files from 19 to 21 and when I compiled my application, the error above showed in the web console and nothing was built.

Ted

tedhohio avatar May 22 '15 18:05 tedhohio

Probably not necessary to have a plunker if we can work out what processor it's trying to run. It sounds like someone has registered a processor but provided the wrong information - so the processor function isn't missing or something like that.

The code I have for that function is:

    function startProcessor(i, renderedRowsToProcess) {
      // Get the processor at 'i'
      var processor = self.rowsProcessors[i].processor;

      // Call the processor, passing in the rows to process and the current columns
      //   (note: it's wrapped in $q.when() in case the processor does not return a promise)
      return $q.when( processor.call(self, renderedRowsToProcess, self.columns) )
        .then(function handleProcessedRows(processedRows) {
          // Check for errors
          if (!processedRows) {
            throw "Processor at index " + i + " did not return a set of renderable rows";
          }

          if (!angular.isArray(processedRows)) {
            throw "Processor at index " + i + " did not return an array";
          }

          // Processor is done, increment the counter
          i++;

          // If we're not done with the processors, call the next one
          if (i <= self.rowsProcessors.length - 1) {
            return startProcessor(i, processedRows);
          }
          // We're done! Resolve the 'finished' promise
          else {
            finished.resolve(processedRows);
          }
        });
    }

Is that what you have? Which line is the line throwing the error - is the processor variable undefined on the self.rowsProcessors[i]? You haven't by any chance created a custom rowsProcessor within your code?

(Actually, I just noticed there is identical code in columnsProcessor too, so also it'd be good to know which one is the one that's throwing the error)

PaulL1 avatar May 22 '15 20:05 PaulL1

I'll have to go back and look this weekend. In the middle of some code issues with production work right now. No, we haven't created a custom rowsProcessor nor have we changed ui-grid source in any way. Just trying to use it because ui-grid offers more functionality than many of the other Angular grid offerings.

Ted

On Fri, May 22, 2015 at 4:36 PM, Paul [email protected] wrote:

Probably not necessary to have a plunker if we can work out what processor it's trying to run. It sounds like someone has registered a processor but provided the wrong information - so the processor function isn't missing or something like that.

The code I have for that function is:

function startProcessor(i, renderedRowsToProcess) {
  // Get the processor at 'i'
  var processor = self.rowsProcessors[i].processor;

  // Call the processor, passing in the rows to process and the current columns
  //   (note: it's wrapped in $q.when() in case the processor does not return a promise)
  return $q.when( processor.call(self, renderedRowsToProcess, self.columns) )
    .then(function handleProcessedRows(processedRows) {
      // Check for errors
      if (!processedRows) {
        throw "Processor at index " + i + " did not return a set of renderable rows";
      }

      if (!angular.isArray(processedRows)) {
        throw "Processor at index " + i + " did not return an array";
      }

      // Processor is done, increment the counter
      i++;

      // If we're not done with the processors, call the next one
      if (i <= self.rowsProcessors.length - 1) {
        return startProcessor(i, processedRows);
      }
      // We're done! Resolve the 'finished' promise
      else {
        finished.resolve(processedRows);
      }
    });
}

Is that what you have? Which line is the line throwing the error - is the processor variable undefined on the self.rowsProcessors[i]? You haven't by any chance created a custom rowsProcessor within your code?

— Reply to this email directly or view it on GitHub https://github.com/angular-ui/ng-grid/issues/3405#issuecomment-104761293 .

tedhohio avatar May 22 '15 20:05 tedhohio

@tedhohio did you have any luck narrowing down the issue, or are you able to see if a newer RC fixes it for you?

c0bra avatar Jun 19 '15 18:06 c0bra

Not yet, I also haven't been able to replicate it in Plunker. Any simple examples migrating from older to newer seem fine. It's only when I do it for my entire application. I'll try again with the latest RC and see what happens. One thing I also noticed. In the older (RC18) we added a right-click context sensitive menu by creating our own directives. When I upgraded to RC21 to replicate the original issue, the row selection failed to display. Not sure why yet, haven't had too much time to look at that yet. Just a heads up.

Ted

On Fri, Jun 19, 2015 at 2:13 PM, Brian Hann [email protected] wrote:

@tedhohio https://github.com/tedhohio did you have any luck narrowing down the issue, or are you able to see if a newer RC fixes it for you?

— Reply to this email directly or view it on GitHub https://github.com/angular-ui/ng-grid/issues/3405#issuecomment-113595496 .

tedhohio avatar Jun 19 '15 19:06 tedhohio

Information sought, no response for some months. Closing.

PaulL1 avatar Nov 18 '15 07:11 PaulL1

I encountered this error because the function that I passed into the registerRowsProcessor method wasn't returning the object that was passed into it. I realize that this has been closed for a couple years but maybe this will be helpful for someone out there.

biclon avatar Mar 31 '17 20:03 biclon