Ejemplo n.º 1
0
 private Task GetPaginationTask(GridRendererContext rendererContext, PaginationButtonType paginationButtonType)
 =>
 paginationButtonType == PaginationButtonType.Previous
        ? rendererContext.TableDataSet.GoToPreviousPage()
        : paginationButtonType == PaginationButtonType.Next
            ? rendererContext.TableDataSet.GoToNextPage()
            : paginationButtonType == PaginationButtonType.First
                ? rendererContext.TableDataSet.GoToFirstPage()
                : rendererContext.TableDataSet.GoToLastPage();
Ejemplo n.º 2
0
        private void RenderButton(GridRendererContext rendererContext, PaginationButtonType buttonType, bool disabled, string buttonArrowClass)
        {
            rendererContext.OpenElement(HtmlTagNames.Button, !disabled ? "pagination-button" : "pagination-button pagination-button-disabled");
            rendererContext.AddDisabled(disabled);
            rendererContext.AddOnClickEvent(() =>
                                            BindMethods.GetEventHandlerValue(async(UIMouseEventArgs e) =>
                                                                             await GetPaginationTask(rendererContext, buttonType))
                                            );

            rendererContext.OpenElement(HtmlTagNames.Span, "pagination-button-arrow");
            rendererContext.OpenElement(HtmlTagNames.I, buttonArrowClass);
            rendererContext.CloseElement();
            rendererContext.CloseElement();
            rendererContext.CloseElement();
        }
Ejemplo n.º 3
0
        private void RenderButton(GridRendererContext rendererContext, PaginationButtonType buttonType, bool disabled, string buttonArrowClass)
        {
            rendererContext.OpenElement(HtmlTagNames.Button, !disabled
                ? rendererContext.CssClasses.FooterCssClasses.PaginationButton
                : rendererContext.CssClasses.FooterCssClasses.PaginationButtonDisabled);
            rendererContext.AddDisabled(disabled);
            rendererContext.AddOnClickEvent(() =>
                                            BindMethods.GetEventHandlerValue(async(UIMouseEventArgs e) =>
            {
                await GetPaginationTask(rendererContext, buttonType);
                rendererContext.RequestRerenderNotification?.Invoke();
            })
                                            );

            rendererContext.OpenElement(HtmlTagNames.Span, "pagination-button-arrow");
            rendererContext.OpenElement(HtmlTagNames.I, buttonArrowClass);
            rendererContext.CloseElement();
            rendererContext.CloseElement();
            rendererContext.CloseElement();
        }
Ejemplo n.º 4
0
        private void RenderButton(GridRendererContext rendererContext, PaginationButtonType buttonType, bool disabled, string buttonArrowClass)
        {
            rendererContext.OpenElement(HtmlTagNames.Button, !disabled
                ? rendererContext.CssClasses.FooterCssClasses.PaginationButton
                : rendererContext.CssClasses.FooterCssClasses.PaginationButtonDisabled);
            rendererContext.AddDisabled(disabled);
            rendererContext.AddOnClickEvent(
                EventCallback.Factory.Create(this, async(MouseEventArgs e) =>
            {
                await GetPaginationTask(rendererContext, buttonType);
                rendererContext.RequestRerenderNotification?.Invoke();
            })
                );

            rendererContext.OpenElement(HtmlTagNames.Span, "pagination-button-arrow");
            rendererContext.OpenElement(HtmlTagNames.I, buttonArrowClass);
            rendererContext.CloseElement();
            rendererContext.CloseElement();
            rendererContext.CloseElement();
        }
        private void RenderButton(GridRendererContext rendererContext, PaginationButtonType buttonType, bool disabled, string buttonArrowClass)
        {
            rendererContext.OpenElement(HtmlTagNames.Button, !disabled ? "pagination-button" : "pagination-button pagination-button-disabled");
            rendererContext.AddDisabled(disabled);

            // This is not good but when click function is passed as parameter every button
            // Have seme on click events
            rendererContext.AddOnClickEvent(() => BindMethods.GetEventHandlerValue((UIMouseEventArgs async) =>
                                                                                   buttonType == PaginationButtonType.Previous
                  ? rendererContext.TableDataSet.GoToPreviousPage()
                  : buttonType == PaginationButtonType.Next
                      ? rendererContext.TableDataSet.GoToNextPage()
                      : buttonType == PaginationButtonType.First
                          ? rendererContext.TableDataSet.GoToFirstPage()
                          : rendererContext.TableDataSet.GoToLastPage()));

            rendererContext.OpenElement(HtmlTagNames.Span, "pagination-button-arrow");
            rendererContext.OpenElement(HtmlTagNames.I, buttonArrowClass);
            rendererContext.CloseElement();
            rendererContext.CloseElement();
            rendererContext.CloseElement();
        }