0

gsp 中选项卡组件的最佳选择是什么?

选项 1 (JQuery)

<div id="tabs">
  <ul>
    <li><a href="${createLink(controller: 'tabcomponent', action: 'search')}">Search</a></li>
    <li><a href="${createLink(controller: 'tabcomponent', action: 'result')}">Result</a></li>
     :

选项 2 (JQuery)

<div id="tabs">
  <ul>
     <li><a href="#tabs-1">Search</a></li>
     <li><a href="#tabs-2">Result</a></li> 
       :

div id="tabs-1"
  <g:include controller="tabcomponent" action="search"/>
/div
<div id="tabs-2">
    <g:include controller="tabcomponent" action="result"/>
</div>

选项 3(RichUI 插件)

<resource:tabView />

<richui:tabView id="tabView">
    <richui:tabLabels>
        <richui:tabLabel selected="true" title="My Tab 1" />
     </richui:tabLabels>

    <richui:tabContents>

在选项 2 和 3 中,选项卡(页面)不会动态加载,即所有选项卡都在页面加载时加载,但选项卡 2(结果)需要根据第一个选项卡操作加载。选项 1 按预期加载页面,但我想知道哪个是最好的使用方式?提前致谢。

4

1 回答 1

1

There's no "best way" to work with tabs. Use the one that you're more familiar with and fit your needs.

JQuery UI also have an option to load tabs with ajax.

于 2013-05-16T18:35:07.377 回答