You are here:
Foswiki
>
Applications/ClassificationApp Web
>
TopicType
>
TopicFunction
>
RenderCategoryEditor
E
dit
A
ttach
Tags:
create new tag
,
view all tags
%TOC{depth="2"}% ---++ Documentation %STARTSECTION{name="documentation" type="section"}% ---+++++ Parameters * THEWEB: the web where to look for classes, defaults to BASEWEB * NAME: name of the formfield to render the browser for * VALUE: list of pre-selected categories * TOP: node from where to start the category * EXCLUDE: pattern of categories to be excluded from the tree * BUTTONS: "on", "off", "top", "bottom": defines where to display the buttons, defaults to on (same as top) * FILTER: optional default text for the search box * ONCLICK: javascript handler to be called when a category is clicked, defaults to selecting the category * HIDENULL: "on" or "off", hide empty categories, defaults to off * NRLEAFS: list of cat:count values that specify the number of leaf nodes per category * NRTOPICS: list of cat:count values that specify the number of topics nodes per category * THEFORMAT: format of the link text; this is a named section as defined in RenderHierarchyAsJSON, defaults to =editor= * DEPTH: number of levels to extract, defaults to infinite depth %ENDSECTION{name="documentation" type="section"}% ---++ Implementation <verbatim class="tml"> %STARTINCLUDE%<!-- --> <noautolink> <div id="clsCatSelector_%IF{"defined NAME" then="%NAME%" else="Category"}%" \ class="clsCatSelector { \ nothingFound:'%MAKETEXT{"Nothing found"}%', \ web:'%IF{"defined THEWEB" then="%THEWEB%" else="%BASEWEB%"}%', \ topic:'%BASEWEB%.%BASETOPIC%', \ fieldname:'%IF{"defined NAME" then="%NAME%" else="Category"}%', \ hidenull: '%IF{"defined HIDENULL" then="%HIDENULL%" else="off"}%', \ root:'%IF{"defined TOP" then="%TOP%" else="TopCategory"}%', \ exclude:'%IF{"defined EXCLUDE" then="%EXCLUDE%"}%', \ format:'%IF{"defined THEFORMAT" then="%THEFORMAT%" else="editor"}%' \ %IF{"defined DEPTH" then=", depth: '%DEPTH%'"}% \ %IF{"defined NRLEAFS" then=", nrleafs: '%NRLEAFS%'"}% \ %IF{"defined NRTOPICS" then=", nrtopics: '%NRTOPICS%'"}% \ %IF{"defined ONCLICK" then=", onclick: function(elem, editor) {$percntONCLICK$percnt}"}% \ }"> <input type="hidden" name="%IF{"defined NAME" then="%NAME%" else="Category"}%" class="clsCategoryField" value="%IF{"defined VALUE" then="%VALUE%"}%" /> %IF{"$'BUTTONS'='top' or $'BUTTONS'='on' or not defined BUTTONS" then="$percntDBCALL{\"%WEB%.%TOPIC%\" section=\"buttons\"}$percnt" else="<!-- no buttons -->" }% <div class="clsBrowser"></div> %IF{"$'BUTTONS'='bottom'" then="$percntDBCALL{\"%WEB%.%TOPIC%\" section=\"buttons\"}$percnt" else="<!-- no buttons -->" }% </div> %DBCALL{"%WEB%.%TOPIC%" section="init"}% </noautolink> <!-- -->%STOPINCLUDE% </verbatim> ---++ init <verbatim class="init"> %STARTSECTION{"init"}%<!-- --> %JQREQUIRE{"treeview, ui"}%<!-- --> %ADDTOZONE{"script" id="CLASSIFICATIONPLUGIN::CATSELECTOR" text="<script src='%PUBURLPATH%/%SYSTEMWEB%/ClassificationPlugin/jquery.catselector.js'></script>" requires="JQUERYPLUGIN::TREEVIEW, JQUERYPLUGIN::UI" }%<!-- --> %ADDTOZONE{"head" id="CLASSIFICATIONPLUGIN::CSS" text="<link rel='stylesheet' href='%PUBURLPATH%/%SYSTEMWEB%/ClassificationPlugin/styles.css' media='all' />" requires="JQUERYPLUGIN::TREEVIEW" }%<!-- -->%ENDSECTION{"init"}% </verbatim> ---++ Buttons <verbatim class="tml"> %STARTSECTION{"buttons"}%<!-- --> <div class="clsButtonBox"> %BUTTON{"%MAKETEXT{"Clear"}%" icon="application" class="clsClearButton"}% %BUTTON{"%MAKETEXT{"Undo"}%" icon="arrow_refresh" class="clsUndoButton"}% %BUTTON{"%MAKETEXT{"Filter"}%" icon="find" class="clsFilterButton"}% <input type="text" name="filter" size="30" value="%IF{"defined FILTER" then="%FILTER%"}%" class="foswikiInputField clsFilterField" style="display:none" /> %CLEAR% </div> <literal><style> .clsButtonBox .jqButton { margin-top:2px; margin-bottom:3px; } </style></literal> <!-- -->%ENDSECTION{"buttons"}% </verbatim> ---++ Test %JQREQUIRE{"debug"}% <div class="foswikiFormSteps"> <div class="foswikiFormStep"> %DBCALL{"%TOPIC%" NAME="Cat1" ONCLICK="showConfirm()" NRLEAFS="TestCategory:10"}% </div> <div class="foswikiFormStep"> %DBCALL{"%TOPIC%" NAME="Cat2" VALUE="TestCategory" BUTTONS="bottom" EXCLUDE="TestCategory2"}% </div> <div class="foswikiFormStep"> %DBCALL{"%TOPIC%" NAME="Cat3" BUTTONS="off" DEPTH="2" THEFORMAT="solrfacet"}% </div> </div> <literal> <script> function showConfirm(cat) { return confirm("Select category "+this.name+"?"); } </script> </literal> %DBCALL{"Applications.RenderFunctionCallers"}% ---++ Copyright © 2006-2013 Michael Daum http://michaeldaumconsulting.com %DBCALL{"Applications.GnuGeneralPublicLicense" section="notice"}%
ApplicationTopic
edit
TopicType
DocuTopic
,
TopicFunction
TopicTitle
Summary
Renders an edit widget for a category formfield
WikiApplication
ClassificationApp
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Edit
w
iki text
|
M
ore topic actions
Topic revision: r1 - 07 Jan 2013,
ProjectContributor
Applications/ClassificationApp
Warning: Can't find topic Applications/ClassificationApp.WebLeftBarExample
Das Urheberrecht © liegt bei den mitwirkenden Autoren. Alle Inhalte dieser Kollaborations-Plattform sind Eigentum der Autoren.