Forum


17:04

22/05/2009

Hi everybody.
First, I want to say what a great tool jqgrid is. It is becoming the foundation of an application I am building. It is just AWESOME!!
I am having a problem, I am using navButtonAdd to add a button that calls a jquery modal that displays an embedded pdf. I am able to open the dialog box no problem and it goes to the right page. But, it doesn't get the "id" variable from the column and I don't know what I am doing wrong. Can someone help me?
Here is the code I am using:
<script>
$(document).ready(function()
{
$("#RecList").jqGrid(
{
url:'include/RecInvFiles.cfc?method=RecInvFiles&AID=<cfoutput>#url.AID#</cfoutput>',
datatype: 'json',
colNames:['file_id','file_class_id','Account','Report Date','Fund Name','Report Class','File Type'],
colModel :[
{name:'file_id',index:'file_id', width:70, sorttype:"int", hidden:true},
{name:'file_class_id',index:'file_class_id', width:70, sorttype:"int", hidden:true},
{name:'Account',index:'Account', width:200, sorttype:"string"},
{name:'DATE',index:'DATE', width:100, align:"left",sorttype:"date", datefmt:"YYYY/MM/DD"},
{name:'Fund',index:'Fund', width:200, sorttype:"string"},
{name:'Classname',index:'Classname', width:200, align:"left",sorttype:"string"},
{name:'Ext',index:'Ext', width:70,align:"left",sorttype:"string"}
],
pager: $('#RecPager'),
rowNum:8,
rowList:[8,12,16],
sortorder: "asc",
sortname: "file_id",
multiselect:false,
viewrecords: true,
imgpath: '/test/script/images',
height:'auto',
hiddengrid: false,
toolbar:[true,"top"],
jsonReader: {
root: "ROWS",
page: "PAGE",
total: "TOTAL",
records:"RECORDS",
cell: "",
id: "0"
}
});
$("#RecList").navGrid(
"#RecPager",{add:false,edit:false,del:false,view:false,search:false,refresh:false}
).navButtonAdd('#RecPager',{caption:"View",onClickButton: function(id)
{
var settings = {bgiframe: true,resizable: false,width:450,height:300,modal: true,overlay: {backgroundColor: '#000',opacity: 0.5},buttons: {'Cancel': function() { $(this).dialog("destroy").remove(); }}};
jqm_launcher('Viewed',"include/view_file.cfm?FLID="+id,settings);
}
});
});
function jqm_launcher( title, page, settings )
{
$("#dialog").dialog("destroy").remove();
$('<div id="dialog" title="'+title+'"></div>').appendTo("body");
$("#dialog").load(page);
$("#dialog").dialog(settings);
};
</script>
I am sure it is something stupid, but any help would be greatly appreciated.
Thanks again.
Most Users Ever Online: 715
Currently Online:
66 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