: параметра пользовательских ссылок в jqgrid
, когда пользователь щелкает по формуле ссылки 1, я хочу, чтобы перенаправить на http://en.wikipedia.org/wiki/7
вместо http://en.wikipedia.org/wiki/Formula 1
где 7 является идентификатором Формулы 1
мой ответ JSON, как ниже
{"rows":[{"id":7,"person":"Michael Schumacher","type":"Sport","name":"Formula 1"},
{"id":8,"person":"Lukas Podolski","type":"Sport","name":"Football"},
{"id":9,"person":"Blaise Pascal","type":"Sport","name":"mathematics"},
{"id":6,"person":"Albert Einstein","type":"Sport","name":"Physics"}]}
кодекс jqgrid является
jQuery("#list2").jqGrid({
url:"***.****",
datatype: "json",
mtype: 'GET',
colNames:['Name','Category','Subcategory'],
colModel:[
{name:'person',index:'person', width:150},
{name:'type',index:'type', width:150},
{name:'name',index:'name', width:150,
formatter: function (cellvalue, options, rowObject) {
var cellPrefix = '';
return cellPrefix + '<a href="http://en.wikipedia.org/wiki/' + cellvalue + '">' +
cellvalue + '</a>';
}}
],
width:"647px",
caption:"How to create custom Unobtrusive links"
});
Что происходит в клетке? – Jai
@Jai cellvalue дает формулу 1 –