Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MVCGrid.Net resets predefined filter values #182

Open
DmitryBoyko opened this issue Feb 27, 2019 · 1 comment
Open

MVCGrid.Net resets predefined filter values #182

DmitryBoyko opened this issue Feb 27, 2019 · 1 comment

Comments

@DmitryBoyko
Copy link

DmitryBoyko commented Feb 27, 2019

Hi!

I use MVCGrid.Net like

<div class="input-group date" id="datetimepicker1" data-target-input="nearest">
  <input data-mvcgrid-type="filter" data-mvcgrid-option="datetimepicker1" id="TimeStart" name="TimeStart" value="@ViewBag.TimeStart" type="text" class="form-control form-control-sm datetimepicker-input" data-target="#datetimepicker1" />
         <div class="input-group-append" data-target="#datetimepicker1" data-toggle="datetimepicker">
          <div class="input-group-text"><i class="fa fa-calendar"></i></div>
  </div>
</div>

And JavaScript

$(function () {
       $('#datetimepicker1').datetimepicker({
                locale: 'ru',
        });
});

So I assume to see value provided via @ViewBag.TimeStart but it seems like it resets value once it is loaded. Would you mind to look at it, please. Thanks!

@DmitryBoyko
Copy link
Author

DmitryBoyko commented Feb 27, 2019

Hi!

I could resolve my needs like

$('#searchButton').click(function () {

                var startDate = $('#datetimepicker1').data('date');
                var endDate = $('#datetimepicker2').data('date');
                var personalName = $('#fieldPersonalFullName').val();
                var deviceName = $('#fieldDeviceFullName').val();

                console.log(startDate);
                console.log(endDate);
                console.log(personalName);
                console.log(deviceName);


                MVCGrid.setAdditionalQueryOptions('AllDiagsGrid',
                    {
                        datetimepicker1: startDate,
                        datetimepicker2: endDate,
                        fieldPersonalFullName: personalName,
                        fieldDeviceFullName: deviceName
                    });  
            });

So no worries at all, folk!
But anyway would be nice to have option reset/dont reset defined filter values.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant