ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
add a parameter to Grid Column ClientFormatFunc
Title:
B
I
{code}
?
Can I give a parameter to the function called in `ClientFormatFunc` ?
Save Changes
Cancel
imen
asked at 24 Apr 2020
Answers
B
I
{code}
?
Yes, so as shown here: https://demo.aspnetawesome.com/GridDemo/CustomFormat if you have something like this: new Column { Bind = "Price", ClientFormatFunc = "formatPrice"}, your function can look like this: function formatPrice(lunch, prop) { return lunch.price + '$'; } but you could also have this: new Column { Bind = "Price", ClientFormatFunc = "fprice('$')"}, and the js function with the 'text' parameter: function fprice(text){ return function(lunch, prop){ return lunch.price + text; } }
Save Changes
Cancel
Omu
answered at 24 Apr 2020
Thank you it works fine
at 27 Apr 2020
imen
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