We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15083
    • 697 Posts
    Hi guys,

    Running revo 2.1.3 advanced.
    xamp running.

    I am making some CMPs with MODext and I have a requirement to show a preview of an image in an update form.

    I am pre-populating the form fields using this.menu.record.
    When the user right-clicks the record it launches my window.

    What I want is a field or xtype that lets me set a preview if the modx-combo-browser has a value.
    I have tried this: but its blank:

    {
                fieldLabel: 'Preview'
                ,name: 'image-preview'
                ,dataIndex: 'image-preview'
                ,renderer:
                function(value) {
                    return 'Preview img here please...';
                    if(value != '')
                    {
                        return 'We have an img, show preview';
                    } else
                    {
                        return '<span class="red">No fail...no img!!!</span>';
                    }
                }
            }


    Any ideas how I might accomplish this?
    Thanks in advance smiley

    J
    [ed. note: jusmeig last edited this post 14 years, 9 months ago.]
      • 15083
      • 697 Posts
      Im the only dev manking CMPs using extjs? smiley
        • 1778
        • 659 Posts
        did you try something like that (to add in the property of the field where you want to display your image
        (I did not test it )
        
            html: '<img src="path/to/your/image.png" />',
            height: 150,
            widht: 250
        


        Cheers
          • 15083
          • 697 Posts
          Thanks for the reply.
          I think what I can do is this, I tried something with other update panels and it seems to work.

          Pull out this.menu.record and access the data rowe directly.
          I can then inject html straight into a blank div.

          I'm sure there is a far easier way to do it, but there is precious little documentation and or tutorials on MODext.
            • 32316
            • 387 Posts
            but there is precious little documentation and or tutorials on MODext.
            Please check this post out:
            https://forums.modx.com/thread/73274/community-challenge-file-200-documentation-bugs-and-i-ll-spend-2-days-to-fix-m#dis-post-407225