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

Android: 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 06 SDK, 2018 Sprint 07 SDK, 2018 Sprint 08 SDK, 2018 Sprint 09 SDK, 2018 Sprint 10 SDK, 2018 Sprint 11 SDK, 2018 Sprint 12 SDK, 2018 Sprint 13 SDK, 2018 Sprint 14 SDK, 2018 Sprint 15 SDK, 2018 Sprint 16 SDK, 2016 Sprint 17 SDK, 2018 Sprint 18 SDK, 2018 Sprint 19 SDK, 2018 Sprint 20 SDK, 2018 Sprint 21

      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:
                gmathews Gary Mathews
                Reporter:
                fmiao Feon Sua Xin Miao
                Reviewer:
                Feon Sua Xin Miao
              • Watchers:
                10 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