javascript-ej1-demos/xlsio/ImportData.html

65 строки
2.4 KiB
HTML
Исходник Обычный вид История

2022-12-22 11:48:37 +03:00
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 1 : XlsIO</title>
<meta charset="utf-8" />
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<link href="../content/bootstrap.min.css" rel="stylesheet" />
<link href="../content/default.css" rel="stylesheet" />
<link href="../content/default-responsive.css" rel="stylesheet" />
<link href="../content/ejthemes/default-theme/ej.web.all.min.css" rel="stylesheet" type="text/css" />
<!--[if lt IE 9]>
<script src="../scripts/jquery-1.11.3.min.js" type="text/javascript"></script>
<![endif]-->
<!--[if gte IE 9]><!-->
<script src="../scripts/jquery-3.4.1.min.js" type="text/javascript"></script>
<!--<![endif]-->
<script src="../scripts/ej.web.all.min.js" type="text/javascript"></script>
<script src="../scripts/properties.js" type="text/javascript"></script>
</head>
<body>
<p>
Essential XlsIO allows to import data directly from various objects like DataTable, CLR Objects, etc.
</p><br/>
<p>
Click the button to view an Excel spreadsheet generated by Essential XlsIO.
Please note that Microsoft Excel Viewer or Microsoft Excel is required to view the resultant document.
</p>
<p>
<label ID="Label1"><b>Import Options</b></label><br/>
<input type="radio" name="ImportType" value="DataTable" >Data Table </input> &nbsp;&nbsp;&nbsp;
<input type="radio" name="ImportType" value="CLRObjects" checked >CLR Objects </input>
</p><br/>
<p>
<button onClick="formSubmit1()" >Create Document</button>
</p>
<br />
<label><b>
Note: The document creation/manipulation functionalities are defined within Web API.</b></label>
<script type="text/javascript">
function formSubmit1(){
var option1 = document.querySelector('input[name = "ImportType"]:checked').value;
var attr = { action:window.baseurl + "api/XlsIO/ImportDataObject", method: "post" };
var form = ej.buildTag("form", "", null, attr);
inputAttr = { name: "ImportType", type: "hidden", value: option1 };
input = ej.buildTag("input", "", null, inputAttr);
form.append(input);
$("body").append(form);
form.submit();
}
</script>
<style>
input[type="radio"]{
margin-right:3px;
}
label{
font-weight:normal;
}
</style>
</body>
</html>