Author Topic: Validation Message - Warning  (Read 2323 times)

DotNetRocks

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 7
    • View Profile
Validation Message - Warning
« on: October 27, 2017, 11:34:19 pm »
Hello,

I am working to add a custom validation rule for a column. When I have it set to warning: false; it will show the error message like it should. however, when I change it to a warning validation, i only get the blue icon in the top right corner and no message. In the documentation it states that the message will appear for warnings and non warnings.

Below is the code I am using.

   validations: [
                 
                        {
                            type: function(ui) {

                                var values = $('#invoice-detail-grid').pqGrid('option', 'dataModel.data');
                                for (var i = 0; i < values.length; i++) {
                                    if (( values[ui.column.dataIndx] ===ui.value) &&
                                        (values['AnotherColumn'] === ui.rowData.AnotherColumn) &&
                                        (values['Testing'] === ui.rowData.Testing) &&
                                        (values['ID'] !== ui.rowData.ID)) {

                                        ui.msg = 'Some Error Message';
                                        return false;

                                    }
                                }
                                return true;
                            },
                            warn: true

                        }
                    ]

Thanks!

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6296
    • View Profile
Re: Validation Message - Warning
« Reply #1 on: October 30, 2017, 10:22:11 am »
warning message appears when cell is focused or hovered with mouse.

It also requires activation of pqTooltip.

Code: [Select]
  grid.widget().pqTooltip(); //attach a tooltip.

Example: https://paramquery.com/pro/demos/editing_instant

DotNetRocks

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Validation Message - Warning
« Reply #2 on: October 30, 2017, 07:07:22 pm »
We do not have a load function, is there another place we should put this?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6296
    • View Profile
Re: Validation Message - Warning
« Reply #3 on: October 30, 2017, 09:19:09 pm »
It can also be put in create function.

Code: [Select]
create: function(){
this.widget().pqTooltip(); //attach a tooltip.
},