ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Enabled or Disable button in Grid row based on a row model property
Title:
B
I
{code}
?
I made a solution for Grid with inline editing that is working for me, I am just wondering if there is a more Elegant (lightweight) way of doing this. new Column { ClientFormatFunc = "ToggleSubmitBtn", Width = 45 } function ToggleSubmitBtn(model) { console.log(model.val); var disb = model.val > 0 ? '' : ' disabled="disabled"'; return '<button type=\"button\" class=\"awe-btn o-glcanb awe-nonselect o-gl o-pad\">Cancel</button>' + '<button type=\"button\" class=\"awe-btn awe-nonselect o-glh o-pad \" ' + disb + ' onclick=\"ClosePrinter(' + model.PrinterID +')\">Submit</button>'; }
Save Changes
Cancel
c4
asked at 06 Mar 2019
it's ok, I've edited it a bit
at 06 Mar 2019
Omu
I see no redundancy anymore Perfect! thank you, Sir.
at 06 Mar 2019
c4
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