Forum


06:47

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 !
12:17

Moderators
08/10/2009

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
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66