0

I'm currently developing with jqGrid 4.4.5 fir the first time and I've run into an old bug that a fix was already found for in past versions, but I'm now developing with jQuery 1.9.1 and jqueryui 1.9.2 as well.

The original issue and fix was posted here. I'm getting exactly the same trouble with the new versions of these plugins, but those familiar with jQuery 1.9 will know that $.browser has been deprecated. This makes the previous solution unusable. Could anyone help with a similar solution, or at least the jqGrid 4.4.5 equivalent of this code in the new version of the plugin?

Note: To add something maybe not mentioned before, this issue will probably be recreate-able with setting your browser zoom to 90% or smaller. At 100% zoom it renders correctly, but anything less than 100% gives trouble. (I need it rendering at 90% zoom).

Note: I have switched back to 4.3.1 to test with the old fix applied and it worked perfectly, so it just seems to be the old trouble with Chrome to me.

Thanks in advance for the help and effort in helping me with the trouble.

Kind Regards,

Pieter.

Community
  • 1
  • 1

1 Answers1

0

you can make the same condition here $.browser in jquery 1.9 using following code and use the same solution posted in the link

you can check the browser condition using below code.

jQuery.uaMatch = function( ua ) {
    ua = ua.toLowerCase();

    var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
        /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
        /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
        /(msie) ([\w.]+)/.exec( ua ) ||
        ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
        [];

    return {
        browser: match[ 1 ] || "",
        version: match[ 2 ] || "0"
    };
};



matched = jQuery.uaMatch( navigator.userAgent );
     //browser = {};
     //var cursorType = evt.target.style.cursor;
       if(matched.browser.toLowerCase()=="mozilla")
        {
    }
else
{
}

other wise if you are referring jquery 1.9 and using 1.4 supported codes means u can refer jquery.migrate .js script file in your application.

http://blog.jquery.com/2013/02/16/jquery-migrate-1-1-1-released/

https://github.com/jquery/jquery-migrate/

Thanks,

Siva

Community
  • 1
  • 1
SivaRajini
  • 7,225
  • 21
  • 81
  • 128
  • Hi Siva, I am using the migrate plugin for jQuery at the moment. (While I teach myself to use it all over again, haha!) The problem is that jqGrid doesn't use it anymore. I'm sure that it still does browser checking, but I need to know where in it's source code and how it accomplishes that with the changes, so that I can apply that same fix. Migrate will allow me to use $.browser, but I don't need that. What I need is the equivalent of the linked question that jqGrid is currently using and where it is in the plugin's source code. Thanks all the same, man! – PieterLourens May 14 '13 at 07:58
  • After relooking the code, it'll probably solve my problem, but isn't there a cleaner way to do this? In jQuery 1.9 the $.browser has been replaced with $.support if I'm understanding things correctly. Is there a corresponding $.support value for $.browser.webkit and $.browser.safari. – PieterLourens May 14 '13 at 09:41
  • am not sure about this $.browser.safari or $.browser.webkit value same to $.support. could you please refer updated code by me it will work in all browsers. you can use that code for checking browser condition. – SivaRajini May 14 '13 at 10:06
  • Well thanks a lot the help Siva! I'll take this to Trirand directly and see if they have anything that can help. – PieterLourens May 15 '13 at 14:11