Forum


07:13

07/03/2009

I have to hide the toolbar search in case all rows are presented on the first page.
I have tried different approaches, but failed.
jQuery(â€#t_listâ€).height(25).hide().filterGrid(â€listâ€,{gridModel:true,gridToolbar:true});
alert(jQuery(â€#listâ€).getGridParam('records'););
if (jQuery(â€#listâ€).getGridParam('records') > 20) {
 jQuery(â€#t_listâ€).height(25).show().filterGrid(â€listâ€,{gridModel:true,gridToolbar:true});
}
Unfortunately the alert always shows NULL.
What am I doing wrong?
02:18

Moderators
30/10/2007

Hello,
Where you call this code?
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
03:53

07/03/2009

jQuery().ready(function() {
jQuery(â€#listâ€).jqGrid({
url:’/shop/mediando/get_product.cfc?#session.urltoken#&method=getMasterproductInfo&id_masterproduct=#id_o_product#&sprach_cd=#sprach_cd#’,
datatype: ‘json’,
mtype: ‘GET’,
#colNames#
colModel:[#colModel#],
pager: ‘#pager’,
height: ‘auto’,
width: 825,
shrinkToFit: false,
imgpath: ‘/shop/javascript/jquery/themes/basic/images’,
loadError: function(xhr,st,err) {alert(’Type: ‘+st+’; Response: ‘+ xhr.status + ‘ ‘+xhr.statusText);},
loadonce: false,
rowNum: 20,
rowList: [20,30,40,50,100],
sortname: ‘PRODUCT_NUMBER’,
sortorder: “ascâ€,
viewrecords: true,
toolbar: [true,"top"],
//The JSON reader. This defines what the JSON data returned from the CFC should look like
jsonReader: {
root: “ROWSâ€, //our data
page: “PAGEâ€, //current page
total: “TOTALâ€, //total pages
records:â€RECORDSâ€, //total records
userdata:â€USERDATAâ€, //Userdata we will pass back for feedback
cell: “â€, //Not Used
id: “0″ //Will default to frist column
},
caption: ‘#session.lang_6000#’
});
jQuery(â€#t_listâ€).height(25).hide().filterGrid(â€listâ€,{gridModel:true,gridToolbar:true});
if (jQuery(â€#listâ€).getGridParam(’records’) > 20) {
jQuery(â€#t_listâ€).height(25).show().filterGrid(â€listâ€,{gridModel:true,gridToolbar:true});
}
////////////////////////////////////////////////////
alert(jQuery(â€#listâ€).getGridParam(’records’););
jQuery(â€#listâ€).navGrid(’#pager’,{edit:false,add:false,del:false,search:false,refresh:false})
.navButtonAdd(â€#pagerâ€,{caption:â€Searchâ€,title:â€Toggle Searchâ€,buttonimg: ‘javascript/jquery/themes/basic/images/find.gif’,
onClickButton:function(){
if(jQuery(â€#t_listâ€).css(â€displayâ€)==â€noneâ€) {
jQuery(â€#t_listâ€).css(â€displayâ€,â€");
} else {
jQuery(â€#t_listâ€).css(â€displayâ€,â€noneâ€);
}
}
});
});
this is the whole code, the colnames and the colmodel is dynamically loaded from the database.
Most Users Ever Online: 715
Currently Online:
59 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