0

I want to implement functionality that is working in FF/Chrome/IE8, in an onSelectRow call. I had heard, "onSelectRow is buggy; you can use gridComplete." So I implemented a jQuery function to alert() the id of a row that is clicked, and it works in IE8 and in IE6 but not IE7, in which it does nothing. So I added, at the top of gridComplete, an unadorned alert() and got... nothing, at least as far as IE7 is concerned. The page loads without reported errors but no alertbox.

Are there alternate IE7-friendly approaches to tell when a somewhat complex jqGrid has finished loading? Can a setTimeout() be called to keep checking on it and then run XYZ when it's ready?

--EDIT--

I have put the source in pastebin at http://pastebin.com/3D2AUjC9.

Christos Hayward
  • 5,777
  • 17
  • 58
  • 113
  • I also tried an alert in loadComplete; nothing seemed to happen. – Christos Hayward May 25 '11 at 18:25
  • 1
    No alert in the `gridComplete` means mostly that the code has exception before the `alert` is called. You should start the same code in debugger. You can use at least [Developer Tools for IE](http://www.microsoft.com/downloads/en/details.aspx?FamilyID=95e06cbe-4940-4218-b75d-b8856fced535) for example. Moreover in such question like youth can be very important which versions of jQuery, jqGrid and jQuery UI you use. The code which can be used to reproduce your problem can be helpful. – Oleg May 25 '11 at 19:08
  • Can the code be throwing an exception without the yellow icon in the lower left-hand corner? There is no yellow triangle when it loads. On my end I'm trying to get an IE7 install that will run Developer Tools; I'm using IE7 Standalone which apparently won't run Developer Tools even if it's installed. – Christos Hayward May 25 '11 at 19:41
  • I'm running jQuery 1.6, jqGrid 4.0.0, and jQuery UI 1.8.12 custom. – Christos Hayward May 25 '11 at 19:43
  • I was wrong; Developer Tools installed in IE7. But where is the JavaScript console? I do not find a JavaScript console obviously available through icons or through the Developer Tools menu. – Christos Hayward May 25 '11 at 19:54
  • I tried Firebug Lite; its console has not reported any errors. – Christos Hayward May 25 '11 at 20:10
  • I recommend you don't use jQuery 1.6: either jQuery 1.6.1 or jQuery 1.5.2. I can repeat, that without the code it is very diffictult to gives any recommendations. – Oleg May 25 '11 at 20:20
  • I've switched to jQuery 1.6.1. The code is at http://pastebin.com/3D2AUjC9 – Christos Hayward May 25 '11 at 22:00

1 Answers1

1

First of all you should remove some syntax errors from your code. Fore example replace

<script src="js/jquery.jBreadCrumb.1.1.js" type="text/javascript"
        language="JavaScript">>

to

<script src="js/jquery.jBreadCrumb.1.1.js" type="text/javascript">/script>

Instead of <script language="JavaScript"> you should use <script type="text/javascript">.

You should fix duplicates in the id="autoDistID".

Remove probebly the first </li> from the following code:

<li><span class="contacts"></span><a href="#">Your
approval requests summary</li></a> 5/3/2011</li>

Your document has two </body> and two </html> closing tags (see the lines 828, 829, 880, 881 of your code).

Moreover you use HTML5 DOCTYPE (<!doctype html>), but use many obsolate attributes: see

<table cellpadding="2px" cellspacing="0" border="0">

for example. I recommend you to clear your code and verify it in the http://validator.w3.org.

Now about your jqGrid problems. You include old jquery.searchFilter.js filter plugin after the jquery.jqGrid.src.js which break the searching of jqGrid and can follows to much more errors because the main code of jqGrid already include new implementation of the Advanced Searching: the grid.filter.js module.

Now we goes back to your main problem with not calling of gridComplete and loadComplete. I didn't found in your code loadError which is strict recommended if you get the data from the server. I suppose, that you have exception in the processing of the server response. In the case the loadError instead of gridComplete or loadComplete will be called.

Look at the answer which has detailed example how the loadError can be used.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • Thank you. I have gone through and corrected most of the validation errors (not all) and commented out jquery.searchFilter.js. I also specified a loadError which is apparently not getting called. New pastebin at http://pastebin.com/xP17UgBk – Christos Hayward May 26 '11 at 14:46
  • @JonathanHayward: If you post the test JSON data which can be used to reproduce the problem or if you post the url of the working solution I could try to debug it. – Oleg May 26 '11 at 16:16
  • Thank you. The behavior triggers both on JSON with production data, and on skeletal/empty JSON: '{"page":1,"total":0,"records":0,"rows":[]}'. There are alerts, but none of them are called from IE7. – Christos Hayward May 27 '11 at 14:30