Forum


08:27

16/09/2008

How can I add icons when using jqgridimport?
I can import a grid fine but navbutton icons are not saved with jqgridexport and are thus not imported. To get around this I add the nav settings after the import:
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#test").jqGridImport({imptype:"json",impurl:"/ajax/load_form_settings.php"});
$("#test").navGrid("#pager_form", {refresh:false, edit:false, add:false, del:false, search:false},
{height:475,width:500,reloadAfterSubmit:false,edithidden:true,
}, // edit options
{}, // add options
{}, // del options
{multipleSearch:true,width:450,Find:"Search",sopt:['eq','ne','lt','le','gt','ge','cn']} // search options
)
.navButtonAdd('#pager_form',{caption:"",title:"Select Columns in the Grid",buttonicon:"ui-icon-wrench",
onClickButton:function(){
jQuery("#test").setColumns();
}
})
.navButtonAdd('#pager_form',{caption:"",title:"Export <?php echo $name; ?> Form to Spreadsheet",buttonicon:"ui-icon-calculator",
onClickButton:function(){
window.open("/ajax/get_form_csv.php","_blank");
}
})
.navButtonAdd('#pager_form',{caption:"",title:"Form Printout for <?php echo $name; ?>",buttonicon:"ui-icon-print",
onClickButton:function(){
window.open("/ajax/get_form_print.php","_blank");
}
});
});
</script>
The grid is displayed but there are no nav buttons and no error.
12:55

16/09/2008

I worked it out.
Needed to use the importComplete option:
function(){
jQuery("#test").setCaption("<?php echo $grid_title; ?>");
jQuery("#test").navGrid("#pager_form",{refresh: true, edit: false, add: false, del: false, search: true})
.navButtonAdd("#pager_form",{caption:"",title:"Select Columns in the Grid",buttonicon:"ui-icon-wrench",onClickButton:function(){jQuery("#test").setColumns();}
});
}
});
Most Users Ever Online: 715
Currently Online:
70 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