Results 1 to 3 of 3

Thread: unable to display multiple images into Dataviiew using xTemplate

  1. #1
    Sencha User
    Join Date
    Jul 2017
    Posts
    9
    Answers
    1

    Default Answered: unable to display multiple images into Dataviiew using xTemplate

    hii m creating a Ext js 4 MVC application in which i want to dislay multiple images using dataview and xTemplate but i m able to display only 1 image, how to acheive displaying multiple images using xTemplate in ext js 4


    Ext.define('AM.view.user.ImageGallery', {
    extend: 'Ext.Panel',
    region: 'center',
    border: 'false',


    initComponent: function () {



    var imagestore = Ext.create('Ext.data.Store', {
    id: 'imagesStore',
    fields: ['url', 'name'],
    data: [{
    url: 'images/images(1).jpg',
    url: 'images/images(2).jpg',
    url: 'images/images(3).jpg'
    }]
    });






    // ImageTemplate for the Data View


    var imageTemplate = new Ext.XTemplate('<tpl for=".">',
    '<div class="thumb-wrap" id="{name}">',
    '<div class="thumb"> <img src="{url}">',

    '</tpl>');





    this.ImagePanel = new Ext.form.Panel({
    padding: '5 5 5 5',
    layout: 'hbox',
    border: false,
    title: 'Image Gallery',
    height: 800,
    width: 1000,
    id: 'img-chooser-view',
    autoScroll: true,
    items: new Ext.create('Ext.view.View', {
    store: Ext.data.StoreManager.lookup('imagesStore'),
    tpl: imageTemplate,
    autoHeight: true,
    multiSelect: true,
    overCls: 'x-view-over',
    itemSelector: 'div.thumb-wrap',
    emptyText: 'No images to display'

    })
    });
    this.items = [this.ImagePanel];
    this.callParent();
    }
    });

  2. The doc example displays multiple images. Are you looking to place multiple images on each line?
    http://docs.sencha.com/extjs/4.2.6/#!/api/Ext.view.View

    Have you seen the dataview examples?
    http://docs.sencha.com/extjs/4.2.6/#...data-view.html

  3. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    The doc example displays multiple images. Are you looking to place multiple images on each line?
    http://docs.sencha.com/extjs/4.2.6/#!/api/Ext.view.View

    Have you seen the dataview examples?
    http://docs.sencha.com/extjs/4.2.6/#...data-view.html

  4. #3
    Sencha User
    Join Date
    Jul 2017
    Posts
    9
    Answers
    1

    Default

    [QUOTE=Gary Schlosberg;1202146]The doc example displays multiple images. Are you looking to place multiple images on each line?
    http://docs.sencha.com/extjs/4.2.6/#!/api/Ext.view.View

    i Already tried above example but m able to display only 1 image...please check my code and suggest me.

Similar Threads

  1. How to display multiple images?
    By maecy in forum Ext: Q&A
    Replies: 7
    Last Post: 29 Sep 2013, 10:33 PM
  2. Replies: 3
    Last Post: 19 Mar 2012, 8:56 AM
  3. Unable to display Hello World in Multiple languages
    By shivakarna40 in forum Community Discussion
    Replies: 7
    Last Post: 3 Jun 2011, 6:31 AM
  4. Ext js display array of images in Ext.XTemplate
    By edwin.deloso in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 6 Feb 2011, 10:55 PM
  5. How to display html images inside xtemplate conditionally
    By Hemant Bob in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 3 Feb 2011, 5:31 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •