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

ListView - setting "allowsSelection" to "false" disables "itemclick" event

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: Release 4.1.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
      • TiSDK 3.3.0.GA
      • iOS 7.1
      • TiCLI 3.3.0
      • Xcode 5.1.1

      Description

      When "allowsSelection" is set to "false" (which means, rows should not show color which means they are selected), "itemclick" event is not fired. I think that is wrong, selection is one thing, clicking on whole list view is whole other thing and it should not be affected by "allowsSelection" property.

      To see this issue, run this code:

      var win = Ti.UI.createWindow({backgroundColor: 'white', top: 20});
      var listView = Ti.UI.createListView({
      	allowsSelection: false
      });
      var sections = [];
       
      var fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits'});
      var fruitDataSet = [
          {properties: { title: 'Apple'}},
          {properties: { title: 'Banana'}},
      ];
      fruitSection.setItems(fruitDataSet);
      sections.push(fruitSection);
       
      var vegSection = Ti.UI.createListSection({ headerTitle: 'Vegetables'});
      var vegDataSet = [
          {properties: { title: 'Carrots'}},
          {properties: { title: 'Potatoes'}},
      ];
      vegSection.setItems(vegDataSet);
      sections.push(vegSection);
       
      listView.setSections(sections);
       
      listView.addEventListener('itemclick', function(e) {
      	alert(e);
      });
       
      win.add(listView);
      win.open();
      

      Click on some row - you should not see alert dialog (and IMO you should).

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ivan.skugor Ivan Skugor
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

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

                  Git Source Code