Forum
05:35
15/10/2009
i formerly used flexgrid in my application but because of jqgrid easy data loading and manipulation, im really interested in using this to my my new site. In flexgrid i was able to select a row and if click it will hide my div then display the details of the user. I want to explain something that flexgrid has and its about the process property.
in flexgrid
{name : 'a.user', width : 100, align : 'left', process:viewHeader, sortable:true}
the javascript function for viewHeader
function viewHeader(celDiv,id)
{
$(celDiv).addClass("pointer");
$(celDiv).click(function(){
$('.toolbar a[title=Header]').trigger('click');
viewdb(id);
});
}
$('#Header').show().siblings('div.panel').hide();
the function of viewHeader was to hide my flexgrid and display an HTML file in the same page.
Does jqgrid has this property or function?
17:30
Moderators
30/10/2007
Hello,
You can use custom formatter for this purpose and set onclick event something like this:
...
colModel :[
...
{name:'some' ... formatter: mycellformatter...},
...
],
...
function mycelformatter(value, options, rowobj)
{
// the rowid is
// rowobj.rowId.
return "<a href='#' onclick='viewHeader(...);return false;' >" +value+"</a>";
}
Hope this helps
You can hide the grid like this $("#gbox_mygrid").hide(), where mygrid is the id of your grid.
Best 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:56
15/10/2009
hi tony,
actually its not a link. the viewHeader is a javascript function that will hide the divHeader or the grid to display its details. Right now i have 2 jqgrid master -details. Right now upon opening the page the 2 jqgrid (master, detail) both loads but what i want to do is not to automatically load the details jqgrid. How can i accomplish this?
this is what i did: also tony is their a single click row? 🙂
ondblClickRow: function(id){
$('.toolbar a[title=Header]').trigger('click');
viewdb(id);
},
thanks
-Dean
12:30
Moderators
30/10/2007
Hello,
I see some things that can be done easy. You concentrate on the grid structure, rather than to see if some method exists
Also step by step.
1. There is a single click event onSelectRow
http://www.trirand.com/jqgridw.....iki:events
2. There is a method called: setGridState which maybe should replace your trigger
http://www.trirand.com/jqgridw.....id_methods
3. You can do it very easy
for the detail grid
$("#detail"). jqGrid({
...
datatype: 'local'
...
});
$("#detail"). jqGrid('setGridParam',{datatype:'json'});
With this code initially the detail does not load the data, but after that accept any request
Best 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.
Most Users Ever Online: 715
Currently Online:
80 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