Forum


00:39

12/11/2009

Hi Everyone,
After weeks of monkeying with Telerik to figure out it was not worth the pain, jqGrid has been a pleasure to work with. I am running into two issues which I have read solutions for but they don't seem to work for me. I have a treegrid (don't think that matters for these issues otherwise I would have posted in the treegrid section) and it seems that hoverrows and loadonce are not working for me. Perhaps a misunderstanding and I could use some help.
Challange 1 - loadonce
Loadonce - I succesfully load my treegrid via ajax and most options work. However, there is a root node with no children so I don't want the ajax to fire again when I expand (or just not expand). I thought loadonce would keep that from happening?
Challange 2 - hoverrows
I was trying to integrate qTip over an image tag I have in the table/tree. However, it doesn't seem that hoverrows when set to false is cancelling the default behavior and showing the jqgrid tip.
I was running v3.5 with no success. I just downloaded v3.6, cleared my cache and still no luck. I am using .net MVC and loading the grid in a partial page. The beauty of the product is, below is all my front-end code for nice tree. If anyone has any comments I would greatly appreciate them!
<script type="text/javascript">
var gridimgpath = 'assets/stylesheets/ui-custom/images';
$(document).ready(function() {
$("#content .scheduleNavImg").qtip({
content: 'This is an active list element',
show: 'mouseover',
hide: 'mouseout'
})
jQuery("#treegrid2").jqGrid({
treeGrid: true,
treeGridModel: 'adjacency',
ExpandColumn: 'menu',
ExpandColClick: false,
url: '/Member/GetTree',
datatype: 'xml',
colNames: ["id", "menu", "menutype", "typeid"],
colModel: [
{ name: 'id', key: true, width: 1, hidden: true, sortable: false },
{ name: 'menu', width: 200, hidden: false, sortable: false },
{ name: 'menutype', width: 1, hidden: true },
{ name: 'typeid', width: 1, hidden: true}],
height: 600,
width: 200,
pager: false,
viewrecords: true,
imgpath: gridimgpath,
loadonce: true,
hoverrows: false,
caption: 'Categories',
onSelectRow: function(row_id) { ClientNodeClicked(jQuery("#treegrid2").getCell(row_id, 2), jQuery("#treegrid2").getCell(row_id, 3)); }
})
});
</script>
<table id="treegrid2" class="scroll" cellpadding="0" cellspacing="0"></table>
Much appreciated,
Brian
10:52

Moderators
30/10/2007

Hello,
I will start with Challange 2.
Let consider what is happen:
You call qtip for elements that have a class "scheduleNavImg". In order to work this these elements should be present into the DOM. Are they present? I think no since you call jqGrid after that where you put these elemnts.
In order towork this you should call this pice of code in gridComplete event.
Challange 1
If the element has no child nodes, then this element is leaf
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.
21:34

12/11/2009

Hi Tony,
Thanks for such a quick response. Regarding the two items.
loadonce
Got it. I will need to loop through my resultset and validate there are children for the category.
hoverrows
First off - thanks for the bit about where to place the qtip code, works like a charm. qtip is now rendering the tips over each of the embedded images for which I have included the specific class.
Second - I am still getting the jqgrid tip. I even attempted to set the default to false in the grid.base.js portion of the min file - and removed the mouseover code which performed the bind. Still getting the tip? I tested this against a basic non treegrid just to make sure and found the same behaviour. One think I did notice is, in IE when the browser does not have focus, I don't get the jqgrid. When it does have focus I do get the tip. With FireFox I get the tip each time.
Here is a small image which demonstrates the issue. Is it possible, like the loadonce issue, I an not quite grasping the intent?
Thanks again!
Brian
00:04

Moderators
30/10/2007

Hello,
By default jqGrid create a title attribute, so if you have custom mouseover and etc, this attribute will be displayed.
IMHO in gridComplete, before you call qtip you should remove the title attribute (also there is solution for this in the forum)
It can look like (since of 3.6 you can use this in all grid events to refer to a grid):
gridComplete : functon () {
$(”td”,this).removeAttr(”title”);
// do other stuff here
});
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:
62 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