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

iOS: ListView item template support CommonJS modules

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 7.5.0
    • Component/s: TiAPI
    • Labels:
    • Story Points:
      8
    • Sprint:
      2018 Sprint 13 SDK

      Description

      According to http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ListItem, the ListView item template only supports a limited set of view classes from the Ti.UI namespace. The type property sets the Ti.UI view to be used, i.e 'Ti.UI.Label'

      var template = {
          childTemplates: [
              { 
                  type: 'Ti.UI.ImageView', 
                  bindId: '',
                  properties: { }
              },
              { 
                  type: 'Ti.UI.Label', 
                  bindId: '',
                  properties: { }
              }
              // supported views http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ListItem
          ],
          events: { }
      };
      

      Instead of composing the listview's UI repeatedly, I would like to be able to use a javascript module in list template, i.e:

      customRow.js

      function Controller() {
          var $ = this;
          $.__views.container = Ti.UI.createView({
              layout: "horizontal",
              width: Ti.UI.SIZE,
              backgroundColor: "transparent"
          });
          $.__views.rname = Ti.UI.createLabel({
              text: "row"
          });
          $.__views.rimg = Ti.UI.createImageView({
              image: 'img.png'
          });
          $.__views.container.add($.__views.rname);
          $.__views.container.add($.__views.rimg);
          _.extend($, $.__views);
          _.extend($, exports);
      }
      module.exports = Controller;
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cwilliams Christopher Williams
                Reporter:
                fmiao Feon Sua Xin Miao
                Reviewer:
                Hans Knöchel
              • Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Source Code