Answer the question
In order to leave comments, you need to log in
How to connect bitrix scripts in the admin panel?
Hello everyone.
I am writing a small module, a problem arose.
On the module page, I connect scripts using the method:
CJSCore::RegisterExt('partner_css_and_js', array(
'js' => array(
'/bitrix/js/partner.module/scripts.js',
),
'css' => array(
'/bitrix/css/partner.module/jquery.qtip.min.css',
),
'lang' => $rootFolder . '/lang/ru/admin_js.php',
'rel' => array('jquery')
));
CJSCore::Init(array("partner_css_and_js"));
<script>
var adminParams = [...];
</script>
Answer the question
In order to leave comments, you need to log in
Don't get hung up on global scope and page execution order.
You are trying to do fully connected things: a variable and a script that works with it, while moving the script into extensions.
If you really want to work with the extension, then use a different paradigm: store classes in the extension js file, and initialize objects with ready-made parameters on the page.
Want to know more? Have a look at the sale.order.ajax or sale.basket.basket components
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question