开发者

JQgrids link to an other view

  1. I have a column with Company Names, all items in column are links.
  2. I have a column with CompanyIds
  3. Each of those links have to send to the same View, but link have to attach its own companyId so i can use it in my view, since i need to do some stuff with companys data.

ive found that i can use this:

edittype:'select', formatter:'showlink', formatoptions:{baselinkurl:'EditReferance.cshtml'}

but it keep saying that my EditReference view does not excists.

My two columns:

name: 'id', index: 'id', width: 50, key: true, editable: true, editrules: { edithidden: false }, hidden: true }, 开发者_C百科 { name: 'FirmaNavn', index: 'FirmaNavn', width: 100, align: 'center', editable: false, edittype:'select', formatter:'showlink', formatoptions:{ baselinkurl:'@Url.Action("EditReferance")'}},


Sorry, but I don't see any important different between the code from your answer and the code from your question. The 'showlink' formatter construct the following string op.baseLinkUrl+op.showAction + '?'+ op.idName+'='+opts.rowId+op.addParam (see here). So if you use baseLinkUrl: '@Url.Action("EditReferance")' or baseLinkUrl: '', showAction: '@Url.Action("EditReferance")' you will have the same results.

You real problem was that you used **wrong case **in the names of property baseLinkUrl of the showlink formatter. Instead of

formatter: 'showlink', formatoptions: {baseLinkUrl: '@Url.Action("EditReferance")'}

you used

formatter: 'showlink', formatoptions: {baselinkurl: '@Url.Action("EditReferance")'}


The Answer was very simple, your column should look like this:

{ name: 'FirmaNavn', index: 'FirmaNavn', width: 100, align: 'center', editable: false, edittype:'select', formatter:'showlink', formatoptions:{ baselinkurl:'', showAction: '@Url.Action("EditReferance")'}}

hope it helps to someone

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜