myOptions = [
{ label: 'SSS', value: 'SSS' },
{ label: 'SPC', value: 'SPC' },
{ label: 'SCR', value: 'SCR' },
{ label: 'ALASK', value: 'ALASK' },
{ label: 'ALBAN', value: 'ALBAN' },
{ label: 'MAYO1', value: 'MAYO1' },
{ label: 'GENZY', value: 'GENZY' }
]
let elQuery = '.criteria__activity'
VirtualSelect.init({
ele: elQuery,
options: myOptions,
hideClearButton: true,
multiple: true,
placeholder: '',
searchPlaceholderText: 'Search here..'
});
let vs = document.querySelector(elQuery)
vs.addEventListener('beforeClose', () => {
if (vs.value.length == 0) {
document.querySelector('.criteria-block .criteria__activity-label').classList.remove('anim')
}
});
vs.addEventListener('beforeOpen', () => {
document.querySelector('.criteria-block .criteria__activity-label').classList.add('anim')
});
$('.button_card_text').click(function (element) {
$cardElement = $(this).closest('.card')
if ($cardElement.find('.front').hasClass('active')) {
$cardElement.find('.front').removeClass('active');
$cardElement.find('.back').removeClass('active');
$cardElement.removeClass('active');
} else {
$cardElement.find('.front').addClass('active');
$cardElement.find('.back').addClass('active');
$cardElement.addClass('active');
}
})
var data = [
{key:'raz', cells:[{val: '1'},{val:'razoviy'}]},
{key:'dva', cells:[{val: '2'},{val:'vtoroy'}],children:[
{key:'poddva', cells:[{val: '2'},{val:'podvtoroy'}],children:
[{key:'podpoddva', cells:[{val: '2'},{val:'podpodvtoroy'}]},{key:'raz', cells:[{val: '1'},{val:'raz'}]}]
},
{key:'poddvadva', cells:[{val: '2'},{val:'podvtoroyvtoroy'}]}
]},
{key:'tri', cells:[{val: '3'},{val:'trtiy'}]}
]
var adres = ['dva','poddva','raz']
var newDataCells = [{val: '1.0'},{val:'raz raz, est svyaz'}]
var lastMath
Object.traverse(data, function(node, value, key, path, depth) {
if(typeof value == 'object' && value.key){
let indexAdres = 0;
if(depth > 0)
indexAdres = depth/2
if(value.key == adres[indexAdres])
lastMath = value
}
});
lastMath.cells = newDataCells
console.log(data)
myMap.geoObjects.events.add('click', function (e) {
// Получение ссылки на дочерний объект, на котором произошло событие.
var object = e.get('target');
console.log(object.properties.get('metaDataProperty.AnyMetaData.number'));
});