Forum
19:11
25/11/2011
e.g. I want to create 2 grids:
<div id="grid_one_area">
<table id="jqGridTable"></table>
</div>
<div id="grid_two_area">
<table id="jqGridTable"></table>
</div>
then I try to create it:
jQuery('#grid_one_area #jqGridTable').jqGrid({...some options...});
jQuery('#grid_two_area #jqGridTable').jqGrid({...some options...});
But, HEY!
Now second grid supersedes first!
OK, I try to change selectors:
<div id="grid_one_area">
<table class="jqGridTable"></table>
</div>
<div id="grid_two_area">
<table class="jqGridTable"></table>
</div>
Now, even first grid creation fails:
I think that is because jqGrid works incorrect with object's selector it was created from and try to figure out "id" of this object.
Plz, fix it or give advice to me, how can i use two or more grids WITH SAME identifiers (this is mandatory rule).
19:27
10/08/2009
Hello millfreedom,
You are definitifely wrong in the first example because you used the same id="jqGridTable" twice on one HTML page. The ids must be unique corresponds to HTML/XHTML specification.
The second example, with the usage of <table class="jqGridTable"></table>, is correct as HTML code, but it can't be used by jqGrid. The problem is that jqGrid require id attribute on the table element. The same requirements exists in some jQuery UI Widgets (the datepicker for example). You don't need to use the id in the selector which create jqGrid, but you have to include id attribute to the table elements. So you have to modify you code to the following
<table id="t_one" class="jqGridTable"></table>
</div>
<div id="grid_two_area">
<table id="t_two" class="jqGridTable"></table>
</div>
Then you can create jqGrid with the code like
or
Regards
Oleg
Most Users Ever Online: 715
Currently Online:
41 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