Results 1 to 3 of 3

Thread: Load html link using actioncolumn

  1. #1
    Sencha User
    Join Date
    Sep 2013
    Posts
    68

    Default Load html link using actioncolumn

    Hi guys. I'm trying to load a an external link to my system using actioncolumn in my grid. But I'm at lost of what to do unlike the button function, I can just use href. I also tried AutoEl but it's not working. Could anyone help me? Here's my codes:

    Code:
        columns: [
        
            
            {
                text: 'Terminals',
                dataIndex: 'plate_number',
                renderer:     function renderDescTarget(val, p, record) {
                                
                                var desc = '';
                                desc = '<p style="color:#000;font-size:12px;">' + val + '</p>';
                                return desc;
                            },            
                            
            },
            {
                text: 'Status',
                dataIndex: 'terminal_status',
                renderer:     function renderDescTarget(val, p, record) {
                            if (val == "ONLINE"){
                                var desc = '';
                                desc = '<p style="color:#458B00;font-size:12px;">' + val + '</p>';
                                return desc;
                                }
                            if (val =="OFFLINE"){
                                var desc = '';
                                desc = '<p style="color:#FF0000;font-size:12px;">' + val + '</p>';
                                return desc;
                                }
                            },            
            
    
    
            },
            {
                text: 'Total Up time',
                dataIndex: 'total_on_hours',
                renderer:     function renderDescTarget(val, p, record) {
                    var desc = '';
                    desc = '<p style="color:#000;font-size:12px;">' + val + ' hours' + '</p>';
                    return desc;
                    }
        
                
            },
            {
                text: 'Total Down time',
                dataIndex: 'total_off_hours',
                renderer:     function renderDescTarget(val, p, record) {
                    var desc = '';
                    desc = '<p style="color:#000;font-size:12px;">' + val + ' hours' + '</p>';
                    return desc;
                    }
        
                
            },
            {
                text: 'Exposure',
                dataIndex: 'total_on_hours',
                renderer:     function renderDescTarget(val, p, record) {
                    var desc = '';
                    desc = '<p style="color:#000;font-size:12px;">' + (val * 60)/30 + ' times' + '</p>';
                    return desc;
                }
            },    
        
        {
                xtype:'actioncolumn',
                text: 'Location',
                width:50,
                items: [{
                    icon: 'shared/icons/fam/application_view_detail.png',
                    tooltip: 'view map',
                    handler: function(grid, dataIndex, colIndex) {
                        var rec = grid.getStore().getAt(dataIndex);
                        var scope = dlti.controller.DLTIController.getInstance();
                        scope.terminalidmap();
                        
                    },
                    autoEl: {tag: 'a', target:'_blank', href: 'http://localhost/dlti/Main.html', html: 'View Map', width:400, height:400},
                },
            
                ],
            }
        ],

  2. #2
    Sencha User
    Join Date
    Mar 2011
    Location
    Hyderabad
    Posts
    106
    Answers
    10

    Default

    Check the below example, hope this may help you
    http://docs.sencha.com/extjs/4.1.3/#...rray-grid.html

  3. #3
    Sencha User
    Join Date
    Sep 2013
    Posts
    68

    Default

    Thanks! I already solved the problem with window.open();

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
  •