Forum
Topic RSS
23:00
21/01/2010
OfflineI'm trying to figure out how to make the jqGrid behave similar to how grids work in most applications, but I'm not sure if all of these behaviors currently exist. I'm using version 3.6.4.
Basically, what I need to do.
1. Allow multiselect with the ctrl key.
2. Allow to click a single row without holding down ctrl key when multiselect is on
3. Allow the use of the shift key to select multiple rows at one time. So if I click row 2 and then hold down shift and click row 6, rows 2-6 are selected.
Is it possible to have all these options at once?
When I have multiselect enabled and multikey set, I can't select a single row at a time, it always forces me to hold down the ctrl key.
I started writing my own function to allow a user to select a single row when multiselect is on, but I wanted to see if these options are currently available already.
Thanks,
Ben
00:07
21/01/2010
OfflineI've made some headway with this in getting single select to work as well as using the ctr + Click working. I would like to know of better solutions if others have them, or even if there is something I've missed that is built into jqGrid.
Anyway here is what I'm doing. I'm using the gridComplete event and having it run a function called getTable Rows. Here is the code I've written.
function getTableRows() {
$("#entries").each(function(){
var $table = $(this);
var rows = $table.find('tbody > tr').get();
for (var i=0;i<rows.length;i++) {
var $thisRow = rows[i].id;
$("#" + $thisRow).bind("click",function(e){
if (!e.ctrlKey){
clearEntries();
$("#entries").jqGrid('setSelection',this.id);
}
});
}
});
}
function clearEntries() {
$(".cbox:checked").each(function(e){
if ($(this).attr('checked')) {
var id = this.id;
var getUnderscore = id.indexOf("_");
var firstPos = getUnderscore+1;
var lastPos = id.length;
var newID = id.substring(firstPos,lastPos);
$("#entries").jqGrid('setSelection',newID);
}
})
}
Most Users Ever Online: 994
Currently Online:
45 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
Log In
Home