Friday, 5 July 2013

Displaytag table search

if you want to add search filter in display table header then you need (Add tag to insert additional header rows above the automatically generated one. )
Add a new tag, . If present, it specifies additional HTML to be rendered above the generated header row, but still in THEAD.
Displaytag doesn’t allow us to have a custom table header. We Need (displaytag-1.2.jar) with Rhett Sutphin’s patch.


Here i am refer the example :- Struts2 pagination using display tag

Requirement:-


1. (displaytag-1.2.jar) with Rhett Sutphin’s patch.
2. jquery.dataTables.min.js
3. jquery.js


Include these js in (displaytag.jsp) header & download dispalytag-1.2.jar with header patch after that add in your lib folder.


Now Add following script in displaytag.jsp:-
 

Now add tag in displaytag.jsp:-

        


        


Now Everything is done after executing project you get following result :-



Now you type search 001 code following result shown :-



if none of the matching record following result shown :-




If you want to change the look and feel display table add following css:-

1. bootstrap.min.css
2. displaytag-table.css


Now the table shown like this :-


ok everything is done.