ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Grid with search parameters in a popup window
Title:
B
I
{code}
?
Is there an example (MVC Core Grid) where multiple search parameters (using logviewmodel) can be entered for the grid in a modal popup ? I want the user to click a button near the grid that will open a popup with grid search parameters to enter, he fills out one or more, clicks ok and the grid is filtered accordingly. Thanks in advance!
Save Changes
Cancel
Renga Nathan
asked at 10 Dec 2019
Answers
B
I
{code}
?
you could define a `Popup` @(Html.Awe().InitPopup() .Name("searchGrid") .Url(Url.Action("SearchForm")) .Button("Ok", "searchGrid")) @Html.Awe().Button().Text("Open Popup").OnClick(Html.Awe().OpenPopup("searchGrid")) the SearchForm action should return the partial view for the popup and it will contain the search fields and the `searchGrid` function could look like this: function searchGrid() { var popup = $(this); var name = popup.find('[name="name"').val(); var year = popup.find('#year').val(); $('#Grid1').data('api').load({ params: { name: name, year: year } }); } you can see the grid api being used to search here: https://demo.aspnetawesome.com/GridDemo/ClientSideApi instead of `params` you can also use `oparams`, difference being that `oparams` parameters don't persist to the next request (e.g. column or page click)
Save Changes
Cancel
Omu
answered at 10 Dec 2019
Works awesome! Thanks.
at 10 Dec 2019
Renga Nathan
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