Материал из Module developer
Перейти к: навигация, поиск
     // Clearing the text when clicking on the Cancel  button and return of the items in the array on the popup AddDimmer
     IR.AddListener(IR.EVENT_ITEM_RELEASE, addDimmer.GetItem("cancel1"), function() {
        // Clearing the name
        addDimmer.GetItem("NameDevice").Text = ;
        // If the channel is selected, then  
        if (addDimmer.GetItem("Channelnumber").Text != ) {
           // Возвращаем канала в список свободных каналов
           m.push (addDimmer.GetItem("Channelnumber").Text);
           // Clear the channels text 
           addDimmer.GetItem("Channelnumber").Text = ;
        };
        // Filling in the list of free channels 
        fillListFreeChannel();     
     });
     
     //Creating the Dimmer wiget
     IR.AddListener(IR.EVENT_ITEM_RELEASE, addDimmer.GetItem("ok1"), function() {  
        name = addDimmer.GetItem("NameDevice").Text;
        duplicateName=0;
        tName = 0;
        // Coinciding with forbidden symbols 
        // The cycle for checking the array of forbidden symbols 
        for (var k=0; k<simvoli.length; k++) { 
           // If the symbol from the names coincides with the symbol from the array of forbidden symbols, then output an error 
           if (name.indexOf(simvoli[k].toString()) != -1) { 
              tName = 1; 
              break;
           };
        };