Created
May 30, 2016 11:47
-
-
Save d1i1m1o1n/093384d07724dd1ff10c64c1cbf7dcdf to your computer and use it in GitHub Desktop.
Bitrix custom param in "bitrix:main.include" datepicker. Битрикс, параметр у компонента "bitrix:main.include" в виде календаря с возможностью выбора даты
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); | |
$arTemplateParameters = array( | |
'COUNTDOWN_DATE' => array( | |
'NAME' => "Дата окончания", | |
'TYPE' => 'CUSTOM', | |
// свой подключаемый скрипт | |
'JS_FILE' => $templateFolder.'/settings.js', | |
// функция из подключенного скрипта JS_FILE, вызывается при отрисовке окна настроек | |
'JS_EVENT' => 'OnMySettingsEdit', | |
// доп. данные, передаются в функцию из JS_EVENT | |
'JS_DATA' => json_encode(array('set' => '')), | |
'DEFAULT' => null, | |
'PARENT' => 'BASE', | |
), | |
); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function OnMySettingsEdit(arParams) { | |
arParams.oInput.type = "text"; | |
arParams.oInput.onclick = BX.delegate(function() { | |
BX.calendar({ | |
node: arParams.oInput, | |
//value: arParams.oInput.value, | |
field: arParams.oInput, | |
callback_after: function(){ | |
arParams.oInput.value = arParams.oInput.value; | |
} | |
}); | |
return false; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment