ExecuteEverytimeWhenShown() public static method

public static ExecuteEverytimeWhenShown ( jQueryObject element, System.Action callback, bool callNowIfVisible ) : void
element jQueryObject
callback System.Action
callNowIfVisible bool
return void
Example #1
0
 public static void TriggerLayoutOnShow(jQueryObject element)
 {
     LazyLoadHelper.ExecuteEverytimeWhenShown(element, () =>
     {
         element.TriggerHandler("layout");
     }, true);
 }
Example #2
0
        public DataGrid(jQueryObject container, TOptions opt = null)
            : base(container, opt)
        {
            var self = this;

            this.element.AddClass("s-DataGrid").Html("");
            this.element.AddClass("s-" + this.GetType().Name);
            this.element.AddClass("require-layout").Bind("layout", delegate
            {
                self.Layout();
            });

            Title = GetInitialTitle();

            var buttons = GetButtons();

            if (buttons != null)
            {
                CreateToolbar(buttons);
            }

            this.slickContainer = CreateSlickContainer();

            this.view = CreateView();

            this.slickGrid = CreateSlickGrid();

            if (UsePager())
            {
                CreatePager();
            }

            BindToSlickEvents();
            BindToViewEvents();

            if (buttons != null)
            {
                CreateToolbarExtensions();
            }

            UpdateDisabledState();

            if (PopulateWhenVisible())
            {
                LazyLoadHelper.ExecuteEverytimeWhenShown(element, () => self.RefreshIfNeeded(), false);
                if (element.Is(":visible"))
                {
                    view.Populate();
                }
            }
            else
            {
                view.Populate();
            }
        }
Example #3
0
        protected void InitialPopulate()
        {
            var self = this;

            if (PopulateWhenVisible())
            {
                LazyLoadHelper.ExecuteEverytimeWhenShown(element, () => self.RefreshIfNeeded(), false);
                if (element.Is(":visible"))
                {
                    view.Populate();
                }
            }
            else
            {
                view.Populate();
            }
        }