We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1778
    • 659 Posts
    Hi all
    For a component I develop I need a Custom TV wtith multiple input values and the ability to display each of these input values separatly.... But I'm not sure of how to achieve this...
    I had thinking to something like that (all my questions are as comment in the code)
    Picman.TV = function(config){
        config = config || {};  
        Ext.applyIf(config,{
            layout: 'form',
            autoHeight: true,
            defaults: {
                border: false
            },
            forceLayout: true,
            renderTo: 'tv'+config.tv+'-form',
            items: [{
                xtype: 'modx-tabs',
                id: 'tvtabs',
                activeItem: 0,
                activeTab: 0,
                defaults: {
                    border: false, 
                    autoHeight: true
                },
                border: true,
                items: [{
                    title:'item',   
                    defaults: {autoHeight: true},
                    items: [{
                        html: 'tab1 ',
                        items: [{
                            xtype: 'picman-tvgrid', // grid filled with data from custom table
                            preventRender: true
                        },{
                            // here a form to load the values from the item selected in the grid
                            //I suppose I need a new xtype (picman-tvform) to hold the form
                        }]
                        
                    }]            
                }]
            
            }] ,
            tbar: [{
                text: 'Add a tab',
                handler: this.addTab // Add a tab with same structure as tab1
            }]
        });
        Picman.TV.superclass.constructor.call(this,config);
    }
    Ext.extend(Picman.TV,MODx.Panel,{
        addTab: function (){
            // how to know how many tabs are already there ?
            // how to know on which tab am I ?
            // how to add the tab ?
            // I want the added tab have the same structure as the first tab 
        }
    });
    Ext.reg('picman-panel-tv',Picman.TV);
    


    There's only one item/object per tab. Each object/item as multiple fields displayed in a form (under the grid), one of its value is an image url, the image should be previewed...

    I need also a way to output easily each item in a resource content ( [ [ *myTV.item1 ] ], [ [ *myTV.item2 ] ] or something like that -may be using placeholders ? - )

    Is it feasible ?
    I'm not comfortable at all with Custom TV's and any thoughts, advice, guidance, help would be appreciated....
    Cheers