Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
75
How to customize the error msg alert position in iggrid
posted

Hi,

i want to customize the error msg alert position for a single column in one of my iggrid . i have found out the class through inspect element. 

But i don't know how to apply styles for that.

For ex i have 3 columns in a grid

Name   Qualification  Age     

 i have validation in age column , the user can enter age till 59.

I want to change the alert message position when the alert triggers for that particular column only.

while inspect i have found out this code 


<div class="ui-widget ui-igpopover ui-ignotify ui-ignotify-error" style="display: block;left: 445.5px;">

i want to add top position like this(For AGE column only)

<div class="ui-widget ui-igpopover ui-ignotify ui-ignotify-error" style="display: block;top: 9px;left: 445.5px;">

How to do it?

Parents
No Data
Reply
  • 23953
    Offline posted

    Hello George,

     

    You can do this on "errorShowing" event of the igNotifier control:

    errorShowing: function(evt, ui) {

    setTimeout(function () {

    ui.owner.notifier().setCoordinates({top: 100, left: 100});

    }, 0);

    }

     

    Where "top" and "left" are the coordinates where you want to put your alert message.

     

    The resulting configuration will look like this:

    features: [

    {

    name: "Updating",

    columnSettings: [

    {

    columnKey: "age",

    required: true,

    editorOptions: {

    validatorOptions: {

    valueRange: {

    errorMessage: "Value must be between {0} and {1}.",

    min: 1,

    max: 59

    },

    errorShowing: function(evt, ui) {

    setTimeout(function () {

    ui.owner.notifier().setCoordinates({top: 100, left: 100});

    }, 0);

    }

    }

    }

    }

    ]

    }

    ]

     

    Note that you'll need to use "setTimeout" function, because the first time the alert message gets created and the code won't find the igNotifier.

     

    Best regards,
    Martin Pavlov
    Infragistics,
    Inc.

Children