0

I am trying to use jqueryui themes in dandelion datatables. So I started with this link. But, can we pass themeoption at runtime?

<datatables:table id="users" data="${list}" row="user"
     rowIdBase="userId" rowIdPrefix="person_"  pageable="true" displayLength="5"       
     filterable="true"  processing="true" autoWidth="true" 
     theme="jqueryui" 
     themeOption="<spring:theme code="theme"/>" 

or

<datatables:table id="users" data="${list}" row="user"
     rowIdBase="userId" rowIdPrefix="person_"  pageable="true" displayLength="5"       
     filterable="true"  processing="true" autoWidth="true" 
     theme="jqueryui" 
     themeOption="<c:out value="theme"/>" 

I want to use the spring theme. I am using themeResolver and themeChangeInterceptor. Will the theme of datatables change when I will change the theme?

In my theme-default.properties file

css=themes/blue/style.css
theme=start

My theme names are default, green, orange, purple, and red.

datatables's themes I want to use are start, southstreet, humanity, peppergrinder, and flick respectively.

How can I achieve this?

Brian
  • 14,610
  • 7
  • 35
  • 43
prem30488
  • 2,828
  • 2
  • 25
  • 57

1 Answers1

1

All tag attributes accept Runtime Expression values.

Maybe you should try the following syntax:

Example 1:

<spring:theme code="theme" var="springTheme" />
<datatables:table id="users" data="${list}" row="user"
     rowIdBase="userId" rowIdPrefix="person_"  pageable="true" displayLength="5"       
     filterable="true"  processing="true" autoWidth="true" 
     theme="jqueryui" 
     themeOption="${springTheme}">
     ...
</datatables:table>

Example 2:

<datatables:table id="users" data="${list}" row="user"
     rowIdBase="userId" rowIdPrefix="person_"  pageable="true" displayLength="5"       
     filterable="true"  processing="true" autoWidth="true" 
     theme="jqueryui" 
     themeOption="${theme}">
    ...
</datatables>

(Disclaimer required by StackOverflow: I'm the author of Dandelion)

tduchateau
  • 4,351
  • 2
  • 29
  • 40
  • Example 1 worked for me... Great thanks... Can you please suggest me any theme for `red` color css??? – prem30488 Jun 04 '14 at 06:06
  • Also tell me how can I use custom theme if I want to do so.... Thank you in advance.... – prem30488 Jun 04 '14 at 06:24
  • Dandelion-Datatables support all themes from [ThemeRoller](http://jqueryui.com/themeroller/) through the combo: theme="jqueryui" / themeOption="sunny", for example [docs here](http://dandelion.github.io/datatables/features/styling/themes/jqueryui.html). – tduchateau Jun 04 '14 at 07:02
  • How can I apply my own theme downloaded from http://jqueryui.com/themeroller/ named `Purpletheme`?? – prem30488 Jun 04 '14 at 07:28
  • 1
    Please create another question for that ;-) – tduchateau Jun 04 '14 at 07:54
  • I created it, please see here ->> http://stackoverflow.com/questions/24032270/dandelion-datatables-custom-jqueryui-theme – prem30488 Jun 04 '14 at 08:39
  • Hi Please provide solution to my pagination problem... http://stackoverflow.com/questions/37748231/dandelion-datatables-spring-mvc-pagination-disables-if-pipelining-is-false – prem30488 Jun 10 '16 at 12:26