Notifications
Clear all

How do I add custom validation to an editable report?

   RSS

0
Topic starter

I'd like to perform validation on one or more columns in the report's grid before the user updates the rows. How do I add that?

Topic Tags
1 Answer
0
Topic starter

For ExtJS-based reports, you can use a report plugin which adds a custom validator to the grid's One.grid.GridErrorsPlugin instance. Here's a link to the documentation for the validator function.

define(function() {

Ext.ns('MOD');
MOD.ReportPlugin = {
  init: function (report) {
    report.on('gridcreated', function(_, grid) {
      report.gridErrors.validators.push(function(record) {
        // TODO
        
        return {
          message: 'Row-level error message'
          ,fields:[{
            name: 'Site$Name', message: 'Field-level error message'
          }]
        };
      });
    });
  }
};

});
This post was modified 2 months ago by Sean Durkin
© 2020 One Network Enterprises. All rights reserved. Privacy Policy