简体   繁体   English

如何在我的 asp.net 应用程序中添加从 GitHub 下载的 JavaScript 控件(JavaScript 包)

[英]How to add JavaScript control (JavaScript package) downloaded from GitHub in my asp.net application

I am new to GitHub so asking very basic questions.我是 GitHub 的新手,所以提出了非常基本的问题。 I downloaded https://github.com/jspreadsheet/ce package (.zip) file to use in my asp.net web application. I downloaded https://github.com/jspreadsheet/ce package (.zip) file to use in my asp.net web application. I don't know how to add these files in my application.我不知道如何在我的应用程序中添加这些文件。 When I unzip the folder i have got differnt directries and files.当我解压缩文件夹时,我得到了不同的目录和文件。 Not sure how to use these filse in my application.不知道如何在我的应用程序中使用这些文件。 I have created simple new asp.net webform appliation.我创建了简单的新 asp.net 网络表单应用程序。 Please suggest how can I add this control in my application.请建议如何在我的应用程序中添加此控件。 Thank you.谢谢你。

解压文件夹结构

You can follow the following steps to use javascript files and css files in the asp.net webform app.您可以按照以下步骤在 asp.net 网络表单应用程序中使用 javascript 文件和 css 文件。

First , please create two folders(Css,Javascript) in your web app.首先,请在您的 web 应用程序中创建两个文件夹(Css、Javascript)。

Second , you can add all the css files and js files to the correspond folders from the downloaded file.其次,您可以将下载的文件中的所有css文件和js文件添加到对应的文件夹中。

在此处输入图像描述

Third , you can write the following code to reference the files.第三,您可以编写以下代码来引用文件。

<script src="Javascript/index.js"></script>
<script src="https://jsuites.net/v4/jsuites.js"></script>
<link rel="stylesheet" href="Css/jexcel.css" type="text/css" />
<link rel="stylesheet" href="https://jsuites.net/v4/jsuites.css" type="text/css" />

Besides, since I can not find jsuites related file, I used online reference.此外,由于我找不到 jsuites 相关文件,我使用了在线参考。

Finally , you can use the following code to create an online sheet.最后,您可以使用以下代码创建在线表格。

<body>
    <div>The following is table</div>
   <div id="spreadsheet"></div>
</body>
<script>
        var data = [
            ['Jazz', 'Honda', '2019-02-12', '', true, '$ 2.000,00', '#777700'],
            ['Civic', 'Honda', '2018-07-11', '', true, '$ 4.000,01', '#007777'],
        ];

        jspreadsheet(document.getElementById('spreadsheet'), {
            data: data,
            columns: [
                { type: 'text', title: 'Car', width: 120 },
                { type: 'dropdown', title: 'Make', width: 200, source: ["Alfa Romeo", "Audi", "Bmw"] },
                { type: 'calendar', title: 'Available', width: 200 },
                { type: 'image', title: 'Photo', width: 120 },
                { type: 'checkbox', title: 'Stock', width: 80 },
                { type: 'numeric', title: 'Price', width: 100, mask: '$ #.##,00', decimal: ',' },
                { type: 'color', width: 100, render: 'square', }
            ]
        });
</script>

Final result :最终结果

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM