[CLOSED] Reloading a DatePicker

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Reloading a DatePicker

    When I set a date I want to refresh the datepicker so the highlighting is updated and the date is shown. At present the only way I can do this is through a document.location.reload(); to refresh the entire screen which is not ideal.

    The datepicker is in a partial - is it possible to refresh just the partial? Or ideally just the datepicker! The datepicker has a beforeRender function to load the dates from the database which needs to be run on refresh.

    The datepicker will be in a panel if the panel is refreshed does that also trigger a reloading of the ext.net components within it?
    Last edited by Daniil; Sep 03, 2013 at 5:02 AM. Reason: [CLOSED]
  2. #2
    Hi @ATLAS,

    I guess this JavaScript call should do what you need.
    App.DatePicker1.update(App.DatePicker1.value);
  3. #3
    That doesn;t seem to work at all

    $.post(url, { "": dayNo })
                .success(function (result) {
                    // refresh partial view here
                    //document.location.reload();
                    App.HighlightDates.update(App.HighlightDates.value);
                    
                    
                })
                .error(function (result) {
                    //console.log("FAILS:" + result);
                    alert("Cannot Set this date as Unavailable:" + result);
    
                }
                );
    for
    Html.X().DatePicker()
                            .ID("HighlightDates")

    Quote Originally Posted by Daniil View Post
    Hi @ATLAS,

    I guess this JavaScript call should do what you need.
    App.DatePicker1.update(App.DatePicker1.value);
    Last edited by Daniil; Aug 26, 2013 at 3:58 PM. Reason: Please use [CODE] tags
  4. #4
  5. #5
    oops

    $.post(url, { "": dayNo })
    .success(function (result) {
    // refresh partial view here
    //document.location.reload();
    App.HighlightDates.update(App.HighlightDates.value );
    
    
    })
    .error(function (result) {
    //console.log("FAILS:" + result);
    alert("Cannot Set this date as Unavailable:" + result);
    
    }
    );
    for
    Html.X().DatePicker()
    .ID("HighlightDates")
    Quote Originally Posted by Daniil View Post
  6. #6
    There is the following in the second sentence of the item #3:
    Please do not repost the same code block in a new post... just EDIT your original post.
    Please do not repost in the future.

    Seems I don't quite follow what you exactly mean under "reload DatePicker". Please elaborate. What exactly do you need to be reloaded? Is something in the DatePicker configured in the View using the Model and you need to reload it with the new Model?
  7. #7
    I am selecting unavailable dates to be highlit, writing to the database and want to reload the datepicker so that it displays the selected date as a highlit date which it does from a beforeRender function

    Quote Originally Posted by Daniil View Post
    There is the following in the second sentence of the item #3:

    Please do not repost in the future.

    Seems I don't quite follow what you exactly mean under "reload DatePicker". Please elaborate. What exactly do you need to be reloaded? Is something in the DatePicker configured in the View using the Model and you need to reload it with the new Model?
  8. #8
    How does the beforeRender listener look?
  9. #9
    .Listeners(l =>
                            {
                                l.Render.Handler = "this.todayBtn.hide()";
                                l.BeforeRender.Fn = "getEvents";
                                l.Select.Fn = "ConfirmMe";
                            }
    and getEvents is
    function getEvents() {
            var url = "/Api/AssessorApi/RetrieveUserUnavailabilitiesForCalendar";
            $.ajax({
                url: url,
                type: "post",
                cache: false,
                success: function (result) {
                    console.log(result);
                },
                error: function () {
                    alert(GlobalResources.FailedToGetEvents);
                }
            });
        }
    Quote Originally Posted by Daniil View Post
    How does the beforeRender listener look?
  10. #10
    I expected to see the code which do the following:
    it displays the selected date as a highlit date which it does from a beforeRender function
    Apart from a console.log call I don't see anything. Please clarify what is the beforeRender listener supposed to do?

    A full test case to reproduce the problem is appreciated.
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] reloading a node
    By mirwais in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: Nov 29, 2012, 6:58 PM
  2. [CLOSED] Keep selection after reloading a node
    By RCN in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Jun 19, 2012, 11:38 AM
  3. About reloading a TreePanel...
    By kabalkunz in forum 1.x Help
    Replies: 0
    Last Post: Oct 28, 2011, 3:59 PM
  4. Gridview reloading on click event
    By xMAC in forum 1.x Help
    Replies: 1
    Last Post: Dec 11, 2010, 10:16 AM
  5. Window keeps reloading
    By rthiney in forum 1.x Help
    Replies: 1
    Last Post: Jul 24, 2009, 4:48 PM

Posting Permissions