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

iOS TableViewRow structures for className meh does not match

    Details

      Description

      The problem

      In the 3.x CI SDK, the table view rows act funny when className is used. They are not consistent and a message in the log reads:

      [ERROR] TableViewRow structures for className meh does not match
      

      Some of the symptoms are the fact the the label disappears sometimes, or the height of the row changes randomly.

      To reproduce

      var win = Ti.UI.createWindow();
      var table = Ti.UI.createTableView();
       
      function Row(name) {
          var row = Ti.UI.createTableViewRow({className: 'meh', reusable: true, height: Ti.UI.SIZE });
          row.add(Ti.UI.createLabel({text: name}));
          return row;
      }
       
      function reloadOne() {
          var data = [
              Row('Row 1'),
              Row('Row 2'),
              Row('Row 3'),
              Row('Row 4')
          ];
          
          table.setData(data);
      }
       
      function reloadTwo() {
          var data = [
              Row('Row 5'),
              Row('Row 6'),
              Row('Row 7'),
              Row('Row 8')
          ];
          
          table.setData(data);
      }
      win.add(table);
       
      var btnOne = Ti.UI.createButton({
          title : 'click',
      });
      var btnTwo = Ti.UI.createButton({
          title : 'click',
      });
       
      btnOne.addEventListener('click', reloadOne);
      btnTwo.addEventListener('click', reloadTwo);
       
      win.rightNavButton = btnOne;
      win.leftNavButton = btnTwo;
       
      win.open({modal:true});
      

      Copy and paste this into app.js and run it. Click on the buttons on the navigation bar to change the table data.anges randomly.

      To reproduce

      var win = Ti.UI.createWindow();
      var table = Ti.UI.createTableView();
       
      function Row(name) {
          var row = Ti.UI.createTableViewRow({className: 'meh', height: Ti.UI.SIZE });
          row.add(Ti.UI.createLabel({text: name}));
          return row;
      }
       
      function reloadOne() {
          var data = [
              Row('Row 1'),
              Row('Row 2'),
              Row('Row 3'),
              Row('Row 4')
          ];
          
          table.setData(data);
      }
       
      function reloadTwo() {
          var data = [
              Row('Row 5'),
              Row('Row 6'),
              Row('Row 7'),
              Row('Row 8')
          ];
          
          table.setData(data);
      }
      win.add(table);
       
      var btnOne = Ti.UI.createButton({
          title : 'click',
      });
      var btnTwo = Ti.UI.createButton({
          title : 'click',
      });
       
      btnOne.addEventListener('click', reloadOne);
      btnTwo.addEventListener('click', reloadTwo);
       
      win.rightNavButton = btnOne;
      win.leftNavButton = btnTwo;
       
      win.open({modal:true});
      

      Copy and paste this into app.js and run it. Click on the buttons on the navigation bar to change the table data.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mstepanov Max Stepanov
                Reporter:
                penrique Pedro Enrique (Inactive)
              • Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Source Code