jQWidgets Forums

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Reset sortdatafield Reset sortdatafield #47080

    Kelvin
    Participant

    Hi,

    I have implemented by using the second suggested method like below, but somehow it make the call to the server twice. E.g. First I loaded the grid with data and sorted a field called ‘A’, then the next time when I fetch the data again from the server, it first make a call with sortdatafield set to A first then immediate make another call to the server with sortdatafield set to ‘DefaultSortFieldName’. How can I stop the first call?

    
    formatData: function (data) {
         if (init == true) {
               $.extend(data, {sortdatafield: "DefaultSortFieldName" });
               init = false;
         }
         return data;
    }
    

    If is not possible then I think it would be easier to implement the first suggestion by checking the ‘sortorder’ parameter in the server side. if is null, then force a default sort in the server.

    Many thanks


    Kelvin
    Participant

    Thanks for your help.

    I was using 3.0.4 and after changed to 3.1.0 everything work as expected.


    Kelvin
    Participant

    Hi,
    I have a problem when using knockout binding with initial NULL value set on both datatimeinput control.
    The second datetimeinput control allow me to select today’s date from the calendar control but the first datetimeinput control not allow me to select today’s date unless I click the calendar button and then come off it, then it will allow me to select today’s date.
    Many thanks for your help.

    <!DOCTYPE html>
    <html lang=”en”>
    <head>
    <link rel=”stylesheet” href=”../Controls/jqwidgets/styles/jqx.base.css” type=”text/css” />
    <link rel=”stylesheet” href=”../Controls/jqwidgets/styles/jqx.bootstrap.css” type=”text/css” />
    <script type=”text/javascript” src=”../Scripts/jquery-1.10.2.min.js”></script>
    <script type=”text/javascript” src=”../Scripts/knockout-3.0.0.js”></script>
    <script type=”text/javascript” src=”../Controls/jqwidgets/jqxcore.js”></script>
    <script type=”text/javascript” src=”../Controls/jqwidgets/jqxdatetimeinput.js”></script>
    <script type=”text/javascript” src=”../Controls/jqwidgets/jqxcalendar.js”></script>
    <script type=”text/javascript” src=”../Controls/jqwidgets/jqxtooltip.js”></script>
    <script type=”text/javascript” src=”../Controls/jqwidgets/jqxknockout.js”></script>
    <script type=”text/javascript” src=”../Controls/jqwidgets/globalization/globalize.js”></script>
    </head>
    <body>
    <div id=’content’>

    <p>
    first:
    <div id=’d1′ data-bind=”jqxDateTimeInput: {value: dateOfBirthStart, width: ‘110px’, height: ’25’}”>
    </div>
    </p>

    <p>
    second:
    <div id=’d2′ data-bind=”jqxDateTimeInput: {value: dateOfBirthEnd, width: ‘110px’, height: ’25’}”>
    </div>
    </p>

    <script type=”text/javascript”>
    $(document).ready(function () {
    var myViewModel = function () {
    var self = this;
    self.dateOfBirthStart = ko.observable(null);
    self.dateOfBirthEnd = ko.observable(null);
    };

    var viewModel = new myViewModel();

    ko.applyBindings(viewModel);

    //$(“#jqxWidget”).jqxDateTimeInput({ width: ‘300px’, height: ’25px’, closeCalendarAfterSelection: true, theme: ‘bootstrap’ });
    //$(“#jqxWidget”).jqxDateTimeInput({ value: null });

    //$(“#jqxWidget2”).jqxDateTimeInput({ width: ‘300px’, height: ’25px’, closeCalendarAfterSelection: true, theme: ‘bootstrap’ });
    //$(“#jqxWidget2”).jqxDateTimeInput({ value: null });
    });
    </script>
    </div>
    </body>
    </html>

Viewing 3 posts - 1 through 3 (of 3 total)