Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Errors due to search.headers being null
16/12/2009
01:59
Avatar
rituraj_tiwari
New Member
Members
Forum Posts: 2
Member Since:
16/12/2009
sp_UserOfflineSmall Offline

Hi,

In debuging issues I was having with sorting table, I had to make some code changes. Here is a list of what I had to modify in grid.base.js:

  1. grid.headers[k] is undefined in the loop in two places. I had to place a null / undefined check:
    1. Line 899: $(this).css("width",grid.headers[k].width+"px");
    2. Line 1576: $(this).css("width",self.grid.headers[k].width+"px");
  2. Appending sorted row to grid was causing my Firefox to freeze, chew up tons of memory and report unruly script. The problem was happening on line 910: $('tbody',ts.grid.bDiv).append(row);. Since I am not very good with Javascript, I fixed this issue by changing line 903 onwards. Changes are as follows:
    1. Previously:
                      var cn = "";
                      if(ts.p.altRows) cn = ts.p.altclass;
                      $.each(rows, function(i, row) {
                          if(cn) {
                              if(i%2 ==1) $(row).addClass(cn);
                              else $(row).removeClass(cn);
                          }
                          $('tbody',ts.grid.bDiv).append(row); <--- This line was causing freeze
                          row.sortKey = null;
                      });
    2. Now:
                      var cn = "";
                      // Raj change
                      var sRowsText = "";
                      // End Raj change
                      if(ts.p.altRows) cn = ts.p.altclass;
                      $.each(rows, function(i, row) {
                          if(cn) {
                              if(i%2 ==1) $(row).addClass(cn);
                              else $(row).removeClass(cn);
                          }
                          // Raj change: Comment out the append
                          //$('tbody',ts.grid.bDiv).append(row);

                          var jRow = $( row );
                          sRowsText = sRowsText + "<tr id='" + jRow.attr( "id" ) + "' class='" + jRow.attr( "class" ) + "' role='" + jRow.attr( "role" ) + "'>" + jRow.html() + "</tr>";
                          // End Raj change
                          row.sortKey = null;
                      });
                     
                      // Raj change: Clear out displayed rows and append rows to inside of table
                      var dataTable = $('table',ts.grid.bDiv);
                      dataTable.children().remove();
                      dataTable.html( sRowsText );
                      // End Raj change

I hope this is useful.

-Raj

17/12/2009
15:04
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Thanks for these investigations, but you are the only to this moment that reported this behaviour.

IMHO there is something else - and I think that this is coused by the data provided from you.

In order to izolate the problem I suggest you to test your application only with jqGrid removing any other plugins

and js files that are not needed.

Instead I will not do this change.

Thank you

Best Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

30/12/2009
23:41
Avatar
rituraj_tiwari
New Member
Members
Forum Posts: 2
Member Since:
16/12/2009
sp_UserOfflineSmall Offline

Tony,

Thanks for your response. At this point I am not in a position to do extensive testing.  I was hoping that the changes would point to obvious coding bugs since you wrote the code.

I am able to get jqGrid to work satisfactorily with my hack, so I am OK for now.

-Raj

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
103 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information