如何格式化“链接"用jqgrid一言不发? [英] How to format "links" in jqgrid in single words?

查看:100
本文介绍了如何格式化“链接"用jqgrid一言不发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一整列链接是从数据库中检索出来的,就像这样:

I have an entire column of links that are retrieved from the database like this:

https://docs.google.com/viewer?url=www.amada-book.com/uploads/1369072920.zip

如何在网格的列上显示类似html标签? 像这样:

How do I get to show like html tag on the column in my grid? Like this:

< a href=" https://docs.google.com/viewer?url=www.amada-book.com/uploads/1369072920.zip">FILES </a> 

因此,您看到的唯一一个单词是文件",而是一个链接.

So the only word you see is "FILES" but a link.

推荐答案

您可以使用自定义格式化程序在您的列模型中

You can use a custom formatter in your column model

Ex

colModel: [ 
    {
        name:'price', 
        index:'price', 
        width:60, 
        align:"center", 
        editable: true, 
        formatter:function(cellvalue, options, rowObject){
            return '<a href="' + cellvalue + '">FILES </a> '
        }
    },
]

这篇关于如何格式化“链接"用jqgrid一言不发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆