This topic contains 1 reply, has 2 voices, and was last updated by franconob 7 years, 6 months ago.
- Topic
Dear Sir
I create a JavaScript component ,I use this component in create page of b2bcustomer and I have below error on loading pageComponent with the name “orocrm_sales_b2bcustomer_form_dataChannel” is already registered in the layout
could you help me?
regards,
Golriz……component code
define(function (require) {
‘use strict’;var _ = require(‘underscore’),
$ = require(‘jquery’);return function (options) {
//var $identifier = options._sourceElement.find(options.identifier),
var $customerType = options._sourceElement.find(options.customerType),
$box1 = options._sourceElement.find(options.box1),
$box2 = options._sourceElement.find(options.box2),
$box3 = options._sourceElement.find(options.box3);var $lbox1 = $box1.find(‘label’),
$lbox2 = $box2.find(‘label’),
$lbox3 = $box3.find(‘label’);var onCorporation = options.onCorporation || [];
var onPersonal = options.onPersonal || [];$customerType.on(‘change’, function() {
if (_.contains(onCorporation, $(this).val())) {
$box1.addClass(‘hide’);
$box1.find(‘input’).each(function() {
$(this).rules(‘remove’, ‘NotBlank’);
});if ($lbox1.hasClass(‘required’)) {
$lbox1
.removeClass(‘required’)
.find(’em’).html(‘ ‘);
}$box2.removeClass(‘hide’);
$box2.find(‘input’).each(function() {
$(this)
.removeClass(‘hide’)
.rules(‘add’, ‘NotBlank’);
});if (!$lbox2.hasClass(‘required’)) {
$lbox2
.addClass(‘required’)
.find(’em’).html(‘*’);
}$box3.removeClass(‘hide’);
$box3.find(‘input’).each(function() {
$(this)
.removeClass(‘hide’)
.rules(‘add’, ‘NotBlank’);
});if (!$lbox3.hasClass(‘required’)) {
$lbox3
.addClass(‘required’)
.find(’em’).html(‘*’);
}
}
if (_.contains(onPersonal, $(this).val())) {
$box1.removeClass(‘hide’);$box1.find(‘input’).each(function() {
$(this)
.removeClass(‘hide’)
.rules(‘add’, ‘NotBlank’);
});if (!$lbox1.hasClass(‘required’)) {
$lbox1
.addClass(‘required’)
.find(’em’).html(‘*’);
}$box2.addClass(‘hide’);
$box2.find(‘input’).each(function() {
$(this).rules(‘remove’, ‘NotBlank’);
});if ($lbox2.hasClass(‘required’)) {
$lbox2
.removeClass(‘required’)
.find(’em’).html(‘ ‘);
}$box3.addClass(‘hide’);
$box3.find(‘input’).each(function() {
$(this).rules(‘remove’, ‘NotBlank’);
});if ($lbox3.hasClass(‘required’)) {
$lbox3
.removeClass(‘required’)
.find(’em’).html(‘ ‘);
}
}
});};
});
The forum ‘OroCRM – HTML, JavaScript, CSS, Design Questions’ is closed to new topics and replies.