Материал из Module developer
Перейти к: навигация, поиск
  // Removing the selected channel from the list of free channels         
  IR.AddListener(IR.EVENT_LIST_ITEM_CHANGE, list, function(Item, Subitem, TypeEvent, object) {
     // If pressed, then
     if (TypeEvent == 12) {
        // If the channel was selected before, then return it 
        if (addDimmer.GetItem("Channelnumber").Text != ) {
           m.push (addDimmer.GetItem("Channelnumber").Text);
        };
        // Assign the text (channel) you selected to EditBox 
        addDimmer.GetItem("Channelnumber").Text = object.Text; 
        m.splice(Item,1);   //  Removing the selected channel from the list of free channels 
        IR.HidePopup('ListFreeChannel' + moduleID);  // Closing the popup
        fillListFreeChannel();    // Refilling the list of free channels 
     };
  });
  
  // Opening the  AddDevice  window when clicking the button on the Setup wiget
  IR.AddListener(IR.EVENT_ITEM_RELEASE, setup.GetItem("button next 120x120"), function () {
     IR.ShowPopup(addDeviceName);
  });