ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Disable grid default load
Title:
B
I
{code}
?
Hi, I would like to get empty grid for the first time (without request of data on the server). Requests of data must be only on button click. Grid code: @Html.Awe().Grid(Model.GridName, Url.Action("List", "Contractor")).Columns(new Column { Name = "Name" }) I am trying to solve my problem with _oparams_ like these: $(function () { $('#GridId').data('api').load({ oparams: { forceEmpty: true } }); }); But in this case I have two requests on server: - in first request: _forceEmpty = null_ - in second request: _forceEmpty = true_ and I must analyze parameter _forceEmpty_ on controller. Is there any best practice to solve problem?
Save Changes
Cancel
Konstantin
asked at 20 May 2014
you could also use .Parameter("allowReturnData", false), so initially you will return empty grid
at 20 May 2014
Omu
when I use .Parameter("allowReturnData", false) and call load method on button click like these: function ApplyFilter() { $('#GridName').data('api').load({ params: { allowReturnData: true, name: $('#FilterName').val() // other filters... } }); } Post string contains the parameter "allowReturnData" twice: PageSize=10&allowReturnData=false&allowReturnData=true&id=&name=& and in controller I always have: allowReturnData = false
at 20 May 2014
Konstantin
use a different name for the params
at 20 May 2014
Omu
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