ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Parent attribute not resetting on reset button click
Title:
B
I
{code}
?
Hi I am binding my grid with certain dropdowns as parent, my dropdowns look like: @(Html.Awe().AjaxDropdownFor(r => r.ID).Url(Url.Action("GetList", "Controller")) .Parameter("ListType", "Reportee")) @(Html.Awe().AjaxDropdownFor(r => r.UserGroupID).Url(Url.Action("GetList", "Controller")) .Parameter("ListType", "userGroup")) and my grid is using them as : @(Html.Awe().Grid("Grid") .Url(Url.Action("GetGridItems", "Controller")) .LoadOnParentChange(false) .Height(350) .Parent("ID", "FilterValue") .Parent("UserGroupID", "FilterValue")) I have a rest button which calls a jquery function to reset values: <input type="button" value="Reset" onclick="Reset('Grid');" class="awe-btn" /> jquery function is : function Reset(gridName) { $("#ID").parent('.awe-field').find('select').prop('selectedIndex', 0); $("#UserGroupID").parent('.awe-field').find('select').prop('selectedIndex', 0); $('#' + gridName + '').data('api').load(); } On button click call goes to GetGridItems in controller but it still gets values in 'FilterValue' parameter public ActionResult GetGridItems(GridParams g, string search, string[] FilterValue) I want FilterValue to have default values on reset
Save Changes
Cancel
Tanuj Shrivastava
asked at 26 Jul 2016
Answers
B
I
{code}
?
got it, forgot to add the` .change()` method in jquery as you mentioned earlier $("#ID").parent('.awe-field').find('select').prop('selectedIndex', 0).change();
Save Changes
Cancel
Tanuj Shrivastava
answered at 26 Jul 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