ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Action for a selected GRID element
Title:
B
I
{code}
?
I am using a grid with Edit/Delete button. I would like to be able to either: - add a new button like Edit/Delete to make a specific action (in the controller) on the record where the button is - select an item of the grid and having a generic button (close to the Create button above the grid) to be able to run a specific action (in the controller) on the selected record. How can I acheved this ? If I am using selected item, how can I retrieve the selected item in the controller ? Thanks.
Save Changes
Cancel
Alain Rime
asked at 13 Apr 2016
Answers
B
I
{code}
?
you can see this demo: http://prodinner.aspnetawesome.com/Country for selecting multiple items and executing one action in the controller the delete and edit buttons in the demos are an action on the item, the way it works is you generate a button with a js call on the onclick attribute of the button so the edit button in html would like this: <button onclick="awe.open('editCountryGrid', { params:{ Id: '525' })" and this html was generated using Column.ClientFormat where you can write "Id: .Id" and '.Id' will be replaced with the Id value from the row model awe.open is opening a PopupForm (or popup) that was initialized using Html.Awe().InitPopupForm you could use Html.Awe().InitCall and call it using awe.oc this is actually also done in the prodinner demo for the restore button (login in as admin in prodinner and you'll be able to restore deleted items)
Save Changes
Cancel
Omu
answered at 13 Apr 2016
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