ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Problem with Master Detail Crud version 6 (mvc5)
Title:
B
I
{code}
?
I'm having trouble when creating or editing item in Master Detail Crud Item. When creating an item inside the master popup, after clicking Ok on the detail popup I get this: utils.js:1089 Uncaught TypeError: row.closest is not a function at Object.model (utils.js:1089) at Object.sf (utils.js:177) at Object.success (AwesomeMvc.js:1) at u (jquery.min.js:2) at Object.fireWith [as resolveWith] (jquery.min.js:2) at k (jquery.min.js:2) at XMLHttpRequest.<anonymous> (jquery.min.js:2) PDF step by step tutorial https://drive.google.com/open?id=1PKmIWDFsZn09PXD5sI9A02odIXS_fAeJ
Save Changes
Cancel
Leonel Jaime
asked at 15 Apr 2019
Answers
B
I
{code}
?
The problem is that in `Pessoa/Create.cshtml` the grid is inside the context `Html.Awe().BeginContext()` but the call to `Html.InitCrudPopupsForGrid` is outside the context so you're initialising the crud popups for a grid that doesn't exist I would recommend that you follow the code in our demo (https://demo.aspnetawesome.com/MasterDetailCrudDemo first grid, tab "master create view") , and keep the same order of nesting (context, form) and calls to init fixed project: https://files.fm/u/p4xgq4u7
Save Changes
Cancel
Omu
answered at 15 Apr 2019
Thanks for the feedback
at 15 Apr 2019
Leonel Jaime
good night, I was having a problem with this function. itemDeleted: function (gridId) { return function (res) { var $grid = $("#" + gridId); var gapi = dapi($grid); var row = dapi($grid).select(id(res))[0]; <=== BUG! row.find('button').attr('disabled', 'disabled'); row.trigger('itemdelete'); utils.delRow(row); }; }, I modified this function and it worked function id(o) { return o.Id || o.id || o._id; }
at 15 Apr 2019
Leonel Jaime
in the delete post action you must return an object with an property id like in our demo : `Json(new { Id = input.Id }`
at 16 Apr 2019
Omu
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