ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Show/Hide grid Edit button Based on condition return undefined.
Title:
B
I
{code}
?
I am trying to hide/Show edit, delete button based on condition. I am using RAZOR pages to develop my application. I am following your demo https://demo.aspnetawesome.com/GridDemo/CustomFormat to achieve this. I added `Editable = GetUserCount(o.Gccid) > 0,` (This will return true/false) in `MapToGridModel` and `new Column { ClientFormatFunc = "editff", Width = 80 },` in grid. In javescript function I am getting Editable = Undefined. function editff(o) { return o.Editable === false ? '': '@Html.Raw(GridUtils.InlineEditFormat())'; }
Save Changes
Cancel
Jaeger
asked at 08 Jun 2020
try `console.log(o)` inside `editff`, though I presume that you're using asp.net core with default configuration, and the problem is likely related to this: https://github.com/aspnet/Mvc/issues/4283
at 08 Jun 2020
Omu
Editable is coming in camelCase, I found this problem after adding console.log(o); in my editff function. Thank You So much.
at 08 Jun 2020
Jaeger
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK