jquery - Create multiple hyperlinks in single cell of JQGrid -
I am developing an MVC4 application, which has good customer side interaction but today, I have got a specific requirement that JqGrid's cells can have dynamic numbers The approach I am using is:
- To form an array of items in the controller, be formatted as hyperlinks in the Jackgreat
- This array is called JQGrid cell Receive as the value and array array for formatting each R = hyperlink
- Call controller method for each hyperlink
The controller slice for jqGrid :
var jsonData = new {rows = (list Select new {id} line from person.Contact order no, cell = new string [] {convert.Tostring (row contact order noon), convert.Tostring (row contact not opporter), convert.tostring (line serial number) Convert.ToString (row.ModelNo), Convert.tostring (Row.Capacity), Convert.tostring (new obz [] {new {linktext = "22 PDF", link SRC = "MyDrive \\ 22.pdf"}, New {LinkText = "33.pdf", LinkSRC = "Ma Driv \\ 33.pdf "})}}). ToArray ()}; Jason returned (Jessandata, Jansenweivest Behavior, Elove Gate); ['Contract-order no', 'contract order number', 'serial number', 'model number', 'android', '(name:' model no ', width: 150, editable: incorrect, hidden: true, Editorial: {Required: true}}, {name: 'no contract-order', width: 300, editable: false, hidden: false, formattor: function (cellavel, options, line object) {return '& lt; a Href = "/ order list / adorder / modelNo = '+ cellvalue +'" & gt; '+ cellvalue +' & lt; / a & gt; ';}}, {name:' serial number ', width: 150 , Editing (Name: 'ability', width: 150, etc.): {required: true}}, {name: 'model number', width: 150, editable: incorrect, editorial: {essential: true} Editable: Wrong, Editorial: {Required: True}}, {Name: 'Contract Details', Width: 150, Editable: Wrong, Formatter: Function (CellView, Options, Line Object) {Return' & lt; a href = "/ Orderlist / GetPDFFileStream /? RowObject = '+ rowObject +'" target = "_ blank" & gt; + + cellvalue + '
';}}
Please find the necessary solution to get it Recommend knowledge.
I have created for you, which shows related custom format showing the grid
< P>
input data from
which should generate the server.
The definition of
contract related information
column is shown below in the demo{name: Contract d tail ", formatter: function (cellavel) {var i, res =" ", linkInfo; If (cellvalue == empty || $ .isArray (cell value) {return "& amp; nbsp;"; // in case of empty room or error} (i = 0; i & lt; cellvalue.length; i ++) {linkInfo = cellwh [i]; Res + = (res.length & gt; 0 ?, ":" ") + '& lt; a href ="' + linkInfo.LinkSrc + '"target =" _ blank "& gt; + LinkInfo.LinkText + '& lt; / a & gt;'}} Return Rid;}}
Comments
Post a Comment