variable OBJID - Forum

Forum Navigation
You need to log in to create posts and topics.

variable OBJID

есть-ли у кого пример работы с переменной OBJID

Does anyone have an example of working with the OBJID variable?

@lolo use OBJID in a plugin to allow the VisualNEO Web user to select an object from the app he is working on. The variable will return the object name or id. For example if the user selects a Container object your OBJID variable will store something like "Container1".
This is very useful to inject HTML code within the Container using JavaScript or to transform it using CSS.

I hope it helps.

@luishp
я пытаюсь подключить vanilacalendar
I'm trying to connect a vanilla calendar

function pvvVanilaCalendar (idOBJVanila){
  var script = document.createElement("script");
  script.type="text/javascript";
  script.innerHTML="document.addEventListener('DOMContentLoaded', () => {const calendar = new VanillaCalendar('#"+idOBJVanila+"'); calendar.init();});";
  document.getElementsByTagName('body')[0].appendChild(script);
};

ошибок нет, но и календаря тоже нет
no errors, but no calendar either

 

Hi @lolo, what you have done is very strage. It should be something like this:

function pvvVanilaCalendar(idOBJVanila){
  $App["vcalendar"+idOBJVanila] = new VanillaCalendar("#"+idOBJVanila);
  $App["vcalendar"+idOBJVanila].init();
};

Be sure to include the required JavaScript files.

@luishp
спасибо!
я думал, что нужно создать новые елементы и вставить их в страницу.
$App[] - это внутрення команда создающая переменную объект? или тип переменной может быть любым?

Thank you!
I thought that I needed to create new elements and insert them into the page.
Is $App[] an internal command that creates a variable object? or can the variable be of any type?

Is $App[] an internal command that creates a variable object? or can the variable be of any type?

@lolo All the neoScript variables are accessed from JavaScript using $App.
If you use $App.myvar in JavaScript it will become [myvar] in neoScript.
$App.myvar is exactly the same as $App["myvar"] but in the last case you can use a variable instead so consider this:

BeginJS
   thename = "myvar";
   $App[thename] = "Hello!"
EndJS
jsAlert "[myvar]"

I hope it helps.

Gaev and javadrajabihakami have reacted to this post.
Gaevjavadrajabihakami