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
GridDestroy/GridUnload examples
23/09/2010
21:59
Avatar
Energetic Pixels
Lexington, OK, USA
Member
Members
Forum Posts: 40
Member Since:
12/04/2010
sp_UserOfflineSmall Offline

I have some website buttons that are controlling how jqGrid gets called.  Each button group is calling jqgrid with slightly different colModel and onSelectRow operations.  What I am trying to find is a real example where someone has used GridDestroy.

In my html source document, I have:

<div id='theGrid'>
   <table id='searchResults'></table>
   <div id='gridNavBar'>
</div>

If I use GridUnload, it kills the dynamically generated grid with accompanying data.  You can reload the grid but only if you don't change the column model.  Cool.

But with GridDestroy, as I read it in the jqGrid documentation, goes deeper than 'Unload' in that it would remove my table id='searchResults' and my div id='gridNavBar' from the DOM.  And according to the documentation, it also unhooks my jqGrid functionality that was connected to my id 'searchResults'.  So my question is, how do I reinitiate a new grid with different column model if GridDestroy is going to kill my targeted id (searchResults)???

Here is what I am working with so far. 

$("#riot").click( function() {
        var munitionType = jQuery('#searchResults').jqGrid('getGridParam','xmlReader:row');
        if (jQuery('#searchResults').children().length > 0) {   // grid already built
            if (munitionType == 'chem') {  // checks for correct munitions group xml file loaded
                jQuery("#searchResults").jqGrid('setGridParam',{url:"weaponLib/chem_riot.xml"}).trigger("reloadGrid");
                }
            else {
                alert('grid loaded but wrong munitions group xml loaded');
                /*jQuery('#searchResults').jqGrid('GridDestroy', '#gbox_searchResults');  // destroys the grid
                jQuery("#searchResults").jqGrid('setGridParam',{url:"weaponLib/chem_riot.xml"}).trigger("reloadGrid");*/
                }
            }
        else {
            alert("grid not built");
            // build a brand new grid from scratch
            }
        });
12/03/2013
20:15
Avatar
lgframe
New Member
Members
Forum Posts: 1
Member Since:
12/03/2013
sp_UserOfflineSmall Offline

I have similar issues while using it with JQuery Mobile.

Grid  does not refresh the data properly(it only display few coloumn) once I revisit code with new data for the grid

Note that I display grid propery first time.

calling  a method to create a grid as follows:

createGrid();

$("#grid").trigger("reloadGrid"); // id "grid" defined for <table id=grid>

$.mobile.changePage( $page, options ); createGrid();

and method, as follows:

var createGrid = function displayGrid(){

jQuery('#grid').jqGrid({

"jsonReader":{"repeatitems":false,"subgrid":{"repeatitems":false}},

"datatype":"local",

data:sortedMyInfluAarry,
"gridview":true,

.............

...........

colNames:[, , , , , , , ],

"colModel":[ , , , , ,  ,]

});

}

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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