Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9304847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:48:01+00:00 2026-06-18T23:48:01+00:00

Ext.require([ ‘Ext.grid.*’, ‘Ext.data.*’, ‘Ext.panel.*’ ]); Ext.onReady(function(){ Ext.define(‘ImageModel’, { extend: ‘Ext.data.Model’, fields: [‘name’, ‘url’, {name:’size’,

  • 0
Ext.require([
    'Ext.grid.*',
    'Ext.data.*',
    'Ext.panel.*'
]);
Ext.onReady(function(){
    Ext.define('ImageModel', {
        extend: 'Ext.data.Model',
        fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date', dateFormat:'timestamp'}]
    });
    var store = Ext.create('Ext.data.JsonStore', {
        model: 'ImageModel',
        proxy: {
            type: 'ajax',
            url: 'get-images.php',
            reader: {
                type: 'json',
                root: 'images'
            }
        }
    });
    store.load();

    var listView = Ext.create('Ext.grid.Panel', {
        width:425,
        height:250,
        collapsible:true,
        title:'Simple ListView <i>(0 items selected)</i>',
        renderTo: Ext.getBody(),

        store: store,
        multiSelect: true,
        viewConfig: {
            emptyText: 'No images to display'
        },

        columns: [{
            text: 'File',
            flex: 50,
            dataIndex: 'name'
        },{
            text: 'Last Modified',
            xtype: 'datecolumn',
            format: 'm-d h:i a',
            flex: 35,
            dataIndex: 'lastmod'
        },{
            text: 'Size',
            dataIndex: 'size',
            tpl: '{size:fileSize}',
            align: 'right',
            flex: 15,
            cls: 'listview-filesize'
        }]
    });

    // little bit of feedback
    listView.on('selectionchange', function(view, nodes){
        var l = nodes.length;
        var s = l != 1 ? 's' : '';
        listView.setTitle('Simple ListView <i>('+l+' item'+s+' selected)</i>');
    });
});

i have create 2 panel, one is left panel,second is right panel.
the list view are created in the left panel,and the right panel will read the page showimage.php
list view are display file detail,when user select the list view will passing the file name as a parameter “name” to showimage.php, and the right panel will show the image by name are passed from list view select event.(actually the name field are stored file’s ID)

Question

1)how to create the select list view event,when select a list view passing parameter name to showimage.php,and right panel refresh the page and display the image.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T23:48:03+00:00Added an answer on June 18, 2026 at 11:48 pm
    //===========================LIST VIEW===============================
        Ext.define('ImageModel', {
            extend: 'Ext.data.Model',
            fields: ['PicID', 'PicUploadedDateTime','PicData']
        });
    
        var ImgStore = Ext.create('Ext.data.JsonStore', {
            model: 'ImageModel',
            autoLoad: true,
            proxy: {
                type: 'ajax',
                url: 'get-image.php',
                baseParams: {  //here you can define params you want to be sent on each request from this store
                            mainid: 'value1',
                            startdate: 'value2',
                            enddate: 'value3'
                            },
                reader: {
                    type: 'json',
                    root: 'images'
                }
            }
        });
    
        var listView = Ext.create('Ext.grid.Panel', {
            region: 'west',
            id : 'imagelist',
            title: 'Select Image',
            width: 200,
            split: true,
            collapsible: true,
            floatable: false,
            title:'Select Image',
            store: ImgStore,
            multiSelect: false,
            viewConfig: {
                emptyText: 'No images to display'
            },
    
            columns: [
                {
                text: 'Date Time Uploaded',
                //xtype: 'datecolumn',
                //format: 'Y-m-d H:i:s',
                flex: 65,
                width: 100,
                dataIndex: 'PicUploadedDateTime'
            }]
        });
    
        function hexToBase64(str) {
        return btoa(String.fromCharCode.apply(null, str.replace(/\r|\n/g, "").replace(/([\da-fA-F]{2}) ?/g, "0x$1 ").replace(/ +$/, "").split(" ")));
        }
    
        listView.on('selectionchange', function(view, nodes){
            /*
            var nodeIdDisplay = "";
            for(var i = 0; i < nodes.length; i++)
            {
                if(nodeIdDisplay.length > 0)
                    nodeIdDisplay += ",";
                nodeIdDisplay += nodes[i].get("PicID");
            }
            */
            if (nodes[0].get("PicID") > 0){
                //alert(nodes[0].get("PicData"));
                image=Ext.getCmp('displayimage');
                image.setSrc("data:image/jpeg;base64,"+hexToBase64(nodes[0].get("PicData")));
            //console.log(nodes[0].get("PicData"));
            }
        });
    

    this code method is post to the get-image.php,and get all the image in store and then,
    list view on select change event get the image id and display the image on type : 'image' component

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ext.require([ 'Ext.grid.*', 'Ext.data.*', 'Ext.panel.*' ]); Ext.onReady(function(){ Ext.define('ImageModel', { extend: 'Ext.data.Model', fields: ['id', 'url', {name:'size',
this is extjs javascript code Ext.require([ //'Ext.form.*', //'Ext.layout.container.Column', //'Ext.tab.Panel' '*' ]); Ext.onReady(function() { Ext.QuickTips.init();
Ext.define('DigitalPaper.controller.Documents', { extend: 'Ext.app.Controller', views: ['Documents'], stores: ['Documents'], models: ['Documents'], init: function() { console.log('[OK]
Here is my MainView: Ext.define(Test.view.Main, { extend: 'Ext.Panel', config: { cls: 'transp' } });
Below is the code I tried: <script type=text/javascript> Ext.require(['*']); Ext.onReady(function() { Ext.Loader.setConfig({ enabled: true
Ext.Loader.setConfig({enabled: true}); Ext.Loader.setPath('Ext.ux', '../ux'); Ext.require([ 'Ext.window.*', 'Ext.ux.GMapPanel' ]); Ext.onReady(function() { var myMask = new
I am working with Ext.Net1.0. and I am working with Grid Panel with grouping
My grid isnt showing data when put to tab. This grid, store, model, JSON
I'm trying to 'require' some code for the loader, but my current onready function
How to add 'Ext.require' in Sencha Architect 2 for more than one item? In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.