PDA

View Full Version : Load html link using actioncolumn



maecy
2 Apr 2014, 7:37 PM
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:



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},
},

],
}
],

Zinnia
3 Apr 2014, 1:01 AM
Check the below example, hope this may help you
http://docs.sencha.com/extjs/4.1.3/#!/example/grid/array-grid.html

maecy
3 Apr 2014, 1:23 AM
Thanks! I already solved the problem with window.open();