New issue 401 by shroffda...@gmail.com: sjg:grid onBeforeTopics does not
work in 2.5
http://code.google.com/p/struts2-jquery/issues/detail?id=401
(This is for feature requests and bugs in Struts2 jQuery Plugin - for
getting help, please use the User Group.
http://groups.google.com/group/struts2-jquery )
What steps will reproduce the problem?
1. <s:url id="gridBasicUrlId" action="gridBasic" />
<sjg:grid id="gridBasicId" caption="Basic jQuery Grid"
dataType="json" href="%{gridBasicUrlId}" gridModel="gridModel"
rowList="10,15,20" rowNum="15" width="700"
viewrecords="true" pager="true" sortable="false" navigator="false"
>
<sjg:gridColumn name="username" index="username" title="Username"
key="true"
width="8" resizable="false" align="left" sortable="false"
/>
<sjg:gridColumn name="firstName" index="firstName" title="First Name"
width="12" resizable="false" align="left" sortable="false"
/>
<sjg:gridColumn name="lastName" index="lastName" title="Last Name"
width="12" resizable="false" align="left" sortable="false"
/>
<sjg:gridColumn name="emailId" index="emailId" title="Email"
width="20" resizable="false" align="left" sortable="false"
/>
<sjg:gridColumn name="managerName" index="managerName" title="Manager"
width="12" resizable="false" align="left" sortable="false"
/>
<sjg:gridColumn name="projectCode" index="projectCode" title="Project Code"
width="10" resizable="false" align="left" sortable="false"
/>
</sjg:grid>
2. Please see snapshot. The Pagination is shown on extreme right. I have
been facing this issue since previous versions also, and we had fixed this
ourselves. The pagination is shown on extreme right and total number of
records is not shown at all.
3. please see snapshot attached.
Which struts2 version?
struts2-core-2.2.1.jar
Which struts2-jquery plugin version?
struts2-jquery-grid-plugin-2.5.0.jar
struts2-jquery-plugin-2.5.0.jar
Attachments:
BasicJqueryGrid.png 18.6 KB
but whenevr i try, the output is as shown in snapshot... however if i just
add navigator=true, then i get perfect output as in second snapshot.
the showcase when deployed on my local tomcat works perfectly in either
case..
Attachments:
BasicJqueryGrid2.png 28.0 KB
the fix that we had done to make this work... i.e. Page 1 of __ and Total
Pages to be shown in middle of grid bar was to add two topics like this
<script type="text/javascript">
//To resolve grid issues. Called onbeforeload
$.subscribe('beforeGridLoad', function(event,element) {
setGridId("gridBasicId");
});
//To resolve grid issues. Called oncompleteload
$.subscribe('completeGridLoad', function(event,element) {
resolveGridIssues("gridBasicId");
});
</script>
And included sjgrid.js file (attached) which contains the definition of
setGridId and resolveGridIssues. We don't want this sort of patch work to
be done and are hoping that the grid works without such difficulties.
Attachments:
sjGrid.js 2.6 KB
however would like to reiterate that the showcase war is working perfectly
in all cases when deployed on my local tomcat. Can you think of any
specific libraries i might be missing which are required for this.
Comment #4 on issue 401 by johgep: sjg:grid onBeforeTopics does not work in
2.5
http://code.google.com/p/struts2-jquery/issues/detail?id=401
can you please give version 2.5.1 a chance maybe it solves your problem.
don't forget to clear your caches after upgrading.
there are only to jars needed the struts2-jquery-grid-plugin-2.5.1.jar and
struts2-jquery-plugin-2.5.0.jar.
please check also your custom styles and scripts.
why did not i raise an issue before.
we have been struggling with this for almost 6-8 months :)
struggling in a sense that using the sjgrid.js file and have beforetopic
and aftertopic for every single grid within the application. And believe me
we have loads of them.
"please check also your custom styles and scripts."
This sentenced helped.. i stripped away my custom style xyzapp.css from the
jsp, and it worked like a charm.
Now i have to bottle down to the class which was causing this issue.
Thank you so much.
btw i did not have to upgrade. just had to remove my custom xyzapp.css, and
it worked.
Comment #7 on issue 401 by johgep: sjg:grid onBeforeTopics does not work in
2.5
http://code.google.com/p/struts2-jquery/issues/detail?id=401
(No comment was entered for this change.)
this was the class that was causing the issue,
table {
padding: 0px;
border-spacing: 0px;
border-collapse: collapse;
width: 100%;
}
Of this particularly, width: 100%; is the line that causes the issue.
If i remve it the grid displays as it should. :)