Author Topic: how to avoid bootstrap conflict, while using regular expressions,  (Read 152 times)

mraj

  • Newbie
  • *
  • Posts: 46
    • View Profile
Hi
I have given validation for a cell in the grid. when the tooltip pops

I am getting error like this, How to avoid bootstrap conflict,  Please explain step by step for resolving conflict.

Also cursor is able to move outside the cell after the validation. how to arrest if validation fails ?

TypeError: No method named "open"
    at HTMLDivElement.<anonymous> (tooltip.js:617:15)
    at Function.each (jquery.js:367:19)
    at jQuery.fn.init.each (jquery.js:202:17)
    at jQuery.fn.init.jQueryInterface [as tooltip] (tooltip.js:609:17)
    at h.isValidCell (pqgrid.min.js:10:27573)
    at h.isValid (pqgrid.min.js:10:28014)
    at d.isValid (pqgrid.min.js:10:27764)
    at d._digestData (pqgrid.min.js:11:15265)
    at a.updateRow (pqgrid.min.js:14:23726)
    at d.saveEditCell (pqgrid.min.js:11:13778)

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6260
    • View Profile

mraj

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: how to avoid bootstrap conflict, while using regular expressions,
« Reply #2 on: July 29, 2024, 10:27:41 am »
Hi,

I added the following lines in $(function(){


            $.fn.bootstrapBtn = $.fn.button.noConflict();
            $.fn.bootstrapTooltip = $.fn.tooltip.noConflict();

..

at the beginning itself.

conflict got removed. no error is showing. and showing the pqgrid provided tooltip in red color, instead of showing in black color ( previously it was ).

How to arrest the movement of the cursor from the cell if the data provided  is invalid. ?


mraj

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: how to avoid bootstrap conflict, while using regular expressions,
« Reply #3 on: July 29, 2024, 11:32:53 am »
Regular expression as function it is working

{
                                        type: function (ui) {
                                           
                                            var val=ui.value;
                                            let pt = /^(\d+(,\d+)*)?$/;
                                            if (!(pt.test(val))) {
                                               // alert('Not a valid value ');
                                                ui.msg = "Not a Valid Value : " + val;
                                                return false;
                                            }

                                        }
                                    }

where as a regular expression syntax in pq grid it is not working.

{ type: 'regexp', value: '^(\d+(,\d+)*)?$', msg: 'Not in Proper format' }

« Last Edit: July 29, 2024, 11:34:51 am by mraj »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6260
    • View Profile
Re: how to avoid bootstrap conflict, while using regular expressions,
« Reply #4 on: July 29, 2024, 07:59:46 pm »
One is created using literal notation and the other one with a constructor

you need to escape the regexp value string in the same way it's required while using new Regexp(string) by replacing "\" with "\\"

mraj

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: how to avoid bootstrap conflict, while using regular expressions,
« Reply #5 on: August 01, 2024, 09:06:39 am »
Thanks, it worked