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
reloading grid content after modal window closing
08/10/2009
06:47
Avatar
abenhass
Guest
Guests

Hi,

i am using your awesome plugin to show my data in a modal window (UI jquery plugin)

the grid loads my data pretty fine in the first page  load (and in the page reloads), but in the other cases (simple java script calls from within the application buttons) it loads always the same data,

it seems to require a certain data reload, i tried with the method GridUnload but when i made some traces inside the method's code it looks like it's not recognizing my grid ( it stops at this line "if ( !this.grid ) {alert("my custom debug trace :: unable to unload grid"); return;}")

My code is the following

       jQuery(document).ready(function(){
        $("#myWindow").dialog({
            bgiframe: true,
            autoOpen: false,
            autowidth:true,
            width: 800,
            height: 280,
            modal: true,
             resizeStop: function() {
              
                //jQuery("#myGrid").width = $('#myWindow').dialog('option', 'width')- 20;
                //jQuery("#myGrid").height =  $('#myWindow').dialog('option', 'height')- 50;
                //$("#myGrid").width = $('#myWindow').dialog('option', 'width')- 20;
                //mygrid.height =  $('#myWindow').dialog('option', 'height')- 50;
            }
            ,open: function(){                                                            
                        $("#myGrid").GridUnload();
                        $("#myGrid").jqGrid({
                        //TODO transform to full path
                        url:"mydata.php",
                        datatype: 'json',
                        mtype: 'POST',
                        colNames:['Date','Modification','Application','Qui','Valeur','Commentaires'],
                        colModel :[
                           {name:'id', width:80,stype:'label'},
                           {name:'id', width:80,stype:'label'},
                          {name:'v', index:'v',width:80,stype:'label'},
                          {name:'m', index:'m', width:80,stype:'label'},
                          {name:'projet', index:'projet', width:80 ,stype:'label'},
                          {name:'xfn', index:'xfn', width:80 ,stype:'label'},
                        ],
                        pager: jQuery('#pager2'),
                        rowNum:10,
                        rowList:[5,10,15],
                        sortname: 'id',
                        sortorder: "asc",
                        viewrecords: true,
                        caption: 'Caption goes here',
                        width:770
                      })
     
            }
        });
        $('#myWindow').dialog('open');
        });

Thanks a lot !

08/10/2009
12:17
Avatar
Rumen[Trirand]
Moderator
Members

Moderators
Forum Posts: 81
Member Since:
08/10/2009
sp_UserOfflineSmall Offline

My guess here is that you would need to define the grid in the page (e.g. the javascript would not be in the "open" event of the window).

Then, in the "open" event, you can trigger jQuery("#GridID").trigger(”reloadGrid”)

Hope this helps.

Trirand ASP.NET WebForms & MVC components based on jQuery & ThemeRoller

http://www.trirand.net

09/10/2009
02:28
Avatar
abenhass
Guest
Guests

thanks a lot,

the problem was in fact, caused by the event.

so the grid should be unloaded and created outside the open event !Cool

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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