jQWidgets jqxScheduler showToolbar属性

yizhihongxing

下面是关于jQWidgets jqxScheduler showToolbar属性的详细讲解。

showToolbar属性是什么?

jQWidgets jqxScheduler是一个前端组件,提供了一个简单易用的日程安排功能。它的showToolbar属性指定是否显示工具栏。

该属性默认为true,表示显示日程表的工具栏。如果将该属性设置为false,那么工具栏将不会显示。

该属性的类型是布尔值。

如何设置showToolbar属性?

通过设置showToolbar属性的值,来控制是否在日程表中显示工具栏。

以下是设置showToolbar属性的代码示例:

$("#scheduler").jqxScheduler({
    showToolbar: true
});

在上面的代码中,将showToolbar属性设置为true,表示在日程表中显示工具栏。如果将showToolbar属性设置为false,那么工具栏将不会显示。

showToolbar属性的应用示例

下面,我们看一个基于jQWidgets jqxScheduler的示例,演示如何控制showToolbar属性。

示例1

首先,我们创建一个基于jQWidgets jqxScheduler的日程表,并在日程表中显示工具栏。

<!DOCTYPE html>
<html>
<head>
    <title>jQWidgets jqxScheduler示例</title>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
    <link href="https://jqwidgets.com/public/jqwidgets/styles/jqx.base.css" rel="stylesheet">
</head>
<body>
    <div id="scheduler"></div>
    <script>
        $(document).ready(function () {
            $("#scheduler").jqxScheduler({
                width: '100%',
                height: 600,
                date: new Date(),
                resources:
                {
                    colorScheme: "scheme05",
                    dataField: "calendar",
                    source: new $.jqx.dataAdapter({
                        dataType: "json",
                        dataFields: [
                            { name: "id", type: "string" },
                            { name: "name", type: "string" },
                            { name: "calendar", type: "string" }
                        ],
                        localData: [
                            { id: "1", name: "Resource 1", calendar: "cal1" },
                            { id: "2", name: "Resource 2", calendar: "cal1" },
                            { id: "3", name: "Resource 3", calendar: "cal2" }
                        ]
                    })
                },
                appointments:
                [
                    {
                        id: "1",
                        description: "Task 1",
                        location: "",
                        subject: "Task 1",
                        calendar: "cal1",
                        start: new Date(2022, 1, 8, 9, 0, 0),
                        end: new Date(2022, 1, 8, 10, 0, 0)
                    },
                    {
                        id: "2",
                        description: "Task 2",
                        location: "",
                        subject: "Task 2",
                        calendar: "cal2",
                        start: new Date(2022, 1, 8, 11, 0, 0),
                        end: new Date(2022, 1, 8, 12, 0, 0)
                    }
                ],
                views:
                [
                    {
                        type: "month",
                        showWeekNumbers: true,
                        dateHeaderFormat: "yyyy年MM月"
                    },
                    {
                        type: "agenda",
                        agendaDuration: 7,
                        dayNameFormat: "yyyy年MM月dd日",
                        width: "100%",
                        height: 800
                    }
                ],
                showToolbar: true
            });
        });
    </script>
</body>
</html>

在上述代码中,我们将showToolbar属性设置为true,来显示日程表的工具栏。

示例2

接下来,我们创建一个基于jQWidgets jqxScheduler的日程表,并隐藏工具栏。

<!DOCTYPE html>
<html>
<head>
    <title>jQWidgets jqxScheduler示例</title>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
    <link href="https://jqwidgets.com/public/jqwidgets/styles/jqx.base.css" rel="stylesheet">
</head>
<body>
    <div id="scheduler"></div>
    <script>
        $(document).ready(function () {
            $("#scheduler").jqxScheduler({
                width: '100%',
                height: 600,
                date: new Date(),
                resources:
                {
                    colorScheme: "scheme05",
                    dataField: "calendar",
                    source: new $.jqx.dataAdapter({
                        dataType: "json",
                        dataFields: [
                            { name: "id", type: "string" },
                            { name: "name", type: "string" },
                            { name: "calendar", type: "string" }
                        ],
                        localData: [
                            { id: "1", name: "Resource 1", calendar: "cal1" },
                            { id: "2", name: "Resource 2", calendar: "cal1" },
                            { id: "3", name: "Resource 3", calendar: "cal2" }
                        ]
                    })
                },
                appointments:
                [
                    {
                        id: "1",
                        description: "Task 1",
                        location: "",
                        subject: "Task 1",
                        calendar: "cal1",
                        start: new Date(2022, 1, 8, 9, 0, 0),
                        end: new Date(2022, 1, 8, 10, 0, 0)
                    },
                    {
                        id: "2",
                        description: "Task 2",
                        location: "",
                        subject: "Task 2",
                        calendar: "cal2",
                        start: new Date(2022, 1, 8, 11, 0, 0),
                        end: new Date(2022, 1, 8, 12, 0, 0)
                    }
                ],
                views:
                [
                    {
                        type: "month",
                        showWeekNumbers: true,
                        dateHeaderFormat: "yyyy年MM月"
                    },
                    {
                        type: "agenda",
                        agendaDuration: 7,
                        dayNameFormat: "yyyy年MM月dd日",
                        width: "100%",
                        height: 800
                    }
                ],
                showToolbar: false
            });
        });
    </script>
</body>
</html>

在上述代码中,我们将showToolbar属性设置为false,来隐藏日程表的工具栏。

小结

showToolbar属性是jQWidgets jqxScheduler的一个重要属性,用于控制日程表中的工具栏是否显示。通过本文的介绍,我们了解了showToolbar属性的含义、应用场景和设置方法,并给出了两个实例来演示如何控制showToolbar属性。

希望对您有所帮助!

本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:jQWidgets jqxScheduler showToolbar属性 - Python技术站

(0)
上一篇 2023年5月11日
下一篇 2023年5月11日

相关文章

  • JQuery检测一个文本框的内容是否被改变

    一、JQuery监测input输入框内容改变 可以使用JQuery的change事件以及val()方法来监测input输入框内容的改变。具体实现步骤为: 给需要监测的input输入框添加一个id或者class属性。 使用JQuery的change方法监测输入框内容的改变。 在change方法中,使用val方法获取输入框的当前值以及之前的值,进行比较,判断输入…

    jquery 2023年5月12日
    00
  • jQuery学习笔记之总体架构

    jQuery学习笔记之总体架构 完整攻略 背景 在前端开发中,jQuery库是广泛应用的一种JavaScript库。由于其使用简单、功能强大、扩展性强等特性,已经成为开发高质量Web应用程序的首要选择。对于不同技术背景或从未接触过前端技术的学者,学习jQuery是一个很好的入门和了解基础前端技术的方法。 总体结构 本文主要内容是总结了一些关于jQuery学习…

    jquery 2023年5月28日
    00
  • jQWidgets jqxDateTimeInput showFooter属性

    以下是关于“jQWidgets jqxDateTimeInput showFooter属性”的完整攻略,包含两个示例说明: 属性简介 showFooter 属性是 jQWidgets jqxDateTimeInput 控件的一个属性,用于设置是否显示日期时间输入框的底部区域。该属性的语法如下: $("#jqxDateTimeInput")…

    jquery 2023年5月10日
    00
  • jQuery中wrapAll()方法用法实例

    下面是“jQuery中wrapAll()方法用法实例”的完整攻略: 1. wrapAll()方法简介 wrapAll()是一个jQuery方法,它可以将目标元素的所有子元素包裹在一个单一的父元素中。语法如下: $(selector).wrapAll(wrappingElement) 其中,selector为要被包裹的元素的选择器,wrappingElemen…

    jquery 2023年5月28日
    00
  • jQWidgets jqxPasswordInput showStrengthPosition属性

    以下是关于 jQWidgets jqxPasswordInput 组件中 showStrengthPosition 属性的详细攻略。 jQWidgets jqxPasswordInput showStrengthPosition 属性 jQWidgets jqxPasswordInput 组件的 showStrengthPosition 属性用于控制密码强度…

    jquery 2023年5月12日
    00
  • jQuery keyup()方法

    jQuery load()方法用于从服务器加载数据,并将返回的数据放入指定的元素中。该方法是一种简单的方式来从服务器获取HTML、XML、JSON等数据。 以下是load()方法的详细攻略: 语法 $(selector).load(url, data, callback) 参数 selector:必需,用于选择要放置返回数据的元素。 url:必需,用于指定要…

    jquery 2023年5月9日
    00
  • jQWidgets jqxChart saveAsPNG()方法

    jQWidgets 是一个流行的 JavaScript UI 库,提供了许多可定制的 UI 组件。其中一个组件是 jqxChart,它是用于绘制图表的组件。jqxChart 提供多个方法和属性,其中之一是 saveAsPNG()。下面是关于 jqxChart 的 saveAsPNG() 方法的详细攻略: saveAsPNG() 方法概述 saveAsPNG(…

    jquery 2023年5月11日
    00
  • jquery引入外部CDN 加载失败则引入本地jq库

    以下是“jquery引入外部CDN 加载失败则引入本地jq库”的完整攻略,包括两条示例说明。 步骤一:引入CDN 首先,在HTML的head标签中引入jquery的CDN链接。例如: <head> <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.…

    jquery 2023年5月27日
    00
合作推广
合作推广
分享本页
返回顶部