Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-12616

iOS: TableView Click Events dont get added under certain circumstances

    Details

      Description

      If a section is added to a table using table.appendSection, table.sections = [mySection]; any events on a tableview dont work. Below are some samples. What works is contrary to the 3.0 documentation where it says now in 3.x+ the section methods and properties should be used over data:

       
      var win = Ti.UI.createWindow({
      	backgroundColor:"#eee"
      });
      win.open();
       
      var table = Ti.UI.createTableView();
      var section = Ti.UI.createTableViewSection();
      section.headerView = (function() {
      	var view = Ti.UI.createView();
      	var label = Ti.UI.createLabel({ text: "Some Section" });
      	view.add(label);
       
      	return view;
      })();
       
      var row = Ti.UI.createTableViewRow({
      	title: "Row"
      });
       
      section.add(row);
       
      // THIS WILL KILL THE EVENT LISTENER
      //table.sections = [section];
       
      // THIS WILL KILL THE EVENT LISTENER
      //table.appendSection(section);
       
      // THIS WORKS
      //table.setData([section]);
       
      table.addEventListener("click", function(event) {
      	alert("TableView Clicked");
      	Ti.API.debug(event.row);
      });
       
      win.add(table);
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ingo Ingo Muschenetz
                Reporter:
                rblalock Rick Blalock (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-15567
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code