N°931 TagSet widget and its POC are now more generic (to be used in all AttributeSet hierarchy)

This commit is contained in:
Pierre Goiffon
2018-09-26 10:39:23 +02:00
parent e1f96974bb
commit 1530bb89fe
7 changed files with 146 additions and 166 deletions

View File

@@ -2041,15 +2041,15 @@ EOF
case 'TagSet':
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'/js/selectize.min.js');
$oPage->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/selectize.default.css');
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'/js/jquery.itop-tagset-widget.js');
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'/js/jquery.itop-set-widget.js');
$oPage->add_dict_entry('Core:AttributeTagSet:placeholder');
$oPage->add_dict_entry('Core:AttributeSet:placeholder');
/** @var \ormTagSet $value */
$sJson = $oAttDef->GetJsonForWidget($value);
$sInputId = "attr_{$sFormPrefix}{$sAttCode}";
$sHTMLValue = "<div class=\"field_input_zone field_input_tagset\"><input id='$sInputId' name='$sInputId' type='hidden' value='$sJson'></div>{$sValidationSpan}{$sReloadSpan}";
$sScript = "$('#$sInputId').tagset_widget();";
$sScript = "$('#$sInputId').set_widget();";
$oPage->add_ready_script($sScript);
break;