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
hide multiple toolbar search in case all rows on first page
12/05/2009
07:13
Avatar
hpoe
hpoe
Member
Members
Forum Posts: 29
Member Since:
07/03/2009
sp_UserOfflineSmall Offline

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?

15/05/2009
02:18
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

15/05/2009
03:53
Avatar
hpoe
hpoe
Member
Members
Forum Posts: 29
Member Since:
07/03/2009
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information