asp.net mvc 4 - MVC 4, in JQuery grid one column has to be repalaced with picture and be link which opens JQdialog -
i'm beginner in mvc. have column must shown picture (now text) , when user click picture shows dialog new view. googled, can use formatter 1 time, should use implement it?
{ name: 'simtype', label: 'simtype', template: columntemplates.texttemplate, width: 50, editable: true, editrules: { edithidden: false }, formatter: linkformat2, unformat: linkunformat2, editoptions: { disabled: 'disabled' } }, function linkformat2(cellvalue, options, rowobject) { var linkurl = '@url.action("getmobilephonemodels", "mobilephonemodel", new { phonenumber = "id" })'.replace('id', rowobject['phonenumber']); return '<span class="mobilephonemodel"><a href="' + linkurl + '">' + cellvalue + '</a></span>'; } or
function linkformat2(cellvalue, options, rowobject) { var cellvalueint = parseint(cellvalue); if (cellvalueint = "mobile") return "<img src='../../content/images/devices/mobile.png' width='11px' height='20.75px' alt='" + cellvalue + "' title='" + cellvalue + "' />"; } it works separatly, not possible together.
any appreciated. thanks.
i solved combining, if need:
function linkformat2(cellvalue, options, rowobject) { var cellvalueint = parseint(cellvalue); if (cellvalueint = "mobile") { var linkurl = '@url.action("getmobilephonemodels", "mobilephonemodel", new { phonenumber = "id" })'.replace('id', rowobject['phonenumber']); return '<span class="mobilephonemodel"><a href="' + linkurl + '"><img src="../../content/images/devices/mobile.png" width="11px" height="20.75px" alt="' + cellvalue + '" title="' + cellvalue + '" /></a></span>'; } }
Comments
Post a Comment