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_Related Related Topics sp_TopicIcon
jqGrid reload doesn't restore the original state
07/11/2013
22:23
Avatar
umax
Member
Members
Forum Posts: 3
Member Since:
07/11/2013
sp_UserOfflineSmall Offline
  • jqGrid is created and 2 rows are shown
  • one row is selectable and the other is disabled and color is gray
    • $("#"+row_id_string).attr('disabled', true);
    • $("#"+row_id, grid).css({'background-color':'#f0f0f0'});
  • $grid.jqGrid("clearGridData", true); is called
  • now i need to load the grid with new data and restore the original styling and attributes
    • i call $grid.jqGrid({...}) and then $grid.jqGrid('setGridParam', {data : gridData}).trigger('reloadGrid');
    • no rows should be disabled
    • no rows should have color gray
  • but my reloaded grid still has one diabled row with gray color..

i tried gridUnload which removes the grid from view and gridDestroy removes the html..both of which i do not need..

data is loading properly..what am i supposed to do..!

10/11/2013
12:07
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Do you have any jqGrid events called?

It seems you call again

("#"+row_id_string).attr('disabled', true);

Please check your conditions on which case you do this

Can you please provide us a link to the problem?

Regards

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.

19/11/2013
21:16
Avatar
umax
Member
Members
Forum Posts: 3
Member Since:
07/11/2013
sp_UserOfflineSmall Offline

Thank you Tony for replying and i am sorry i didn't notice your reply as i found a solution. Here is what i did.

i added below code in a function and called it when creating the dialog..

var rows = $j("tr.jqgrow", $table[0]);

for (var i = 0; i < rows.length; i++) {

var row_id_string = rows[i].id;

$j("#" + row_id_string).attr('disabled', false);

$j("#" + row_id_string, $table).addClass('enabled-background-color');

}

$table.jqGrid('resetSelection');

$table.jqGrid("clearGridData", true);

19/11/2013
21:19
Avatar
umax
Member
Members
Forum Posts: 3
Member Since:
07/11/2013
sp_UserOfflineSmall Offline

oh i forgot the css, here it is

.enabled-background-color {

background-color: #DFD;

Forum Timezone: Europe/Sofia

Most Users Ever Online: 496

Currently Online:
20 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