我正在尝试加载一个大约有10万行的文件,到目前为止,浏览器已经崩溃(本地)。我在互联网上看了看,Papa Parse似乎可以处理大文件。现在将其减少到大约3-4分钟,以加载到文本区域中。加载文件后,我想再做一些jQuery来做计数和事情,因此过程需要一段时间。有没有办法使csv加载更快?我是否正确使用该程序?
<div id="tabs">
<ul>
<li><a href="#tabs-4">Generate a Report</a></li>
</ul>
<div id="tabs-4">
<h2>Generating a CSV report</h2>
<h4>Input Data:</h4>
<input id="myFile" type="file" name="files" value="Load File" />
<button onclick="loadFileAsText()">Load Selected File</button>
<form action="./" method="post">
<textarea id="input3" style="height:150px;"></textarea>
<input id="run3" type="button" value="Run" />
<input id="runSplit" type="button" value="Run Split" />
<input id="downloadLink" type="button" value="Download" />
</form>
</div>
</div>
$(function () {
$("#tabs").tabs();
});
var data = $('#input3').val();
function handleFileSelect(evt) {
var file = evt.target.files[0];
Papa.parse(file, {
header: true,
dynamicTyping: true,
complete: function (results) { …Run Code Online (Sandbox Code Playgroud) 我已经看到了如何在一个kendo网格中使列可编辑/不可编辑,但是如何通过网格外的按钮使某个列可编辑?
网格开始时不可编辑,但是当在网格外单击按钮时,将使"第2列"可编辑.可以这样做吗?
<button id="Edit">Edit</button>
<div id="grid"></div>
$('#grid").kendoGrid({
pageable: true,
editable: false,
etc...
columns: [
{ field: "Column 1", title: "Column 1" }
{ field: "Column 2", title: "Column 2" }
{ field: "Column 3", title: "Column 3" }
]
})
Run Code Online (Sandbox Code Playgroud) 如何在同一个if语句中进行单击事件和按键操作?
现在我有:
if($('.test').is(':visible;)){
$('button').click(function(e){
..do something here
}else {
..do something here
});
Run Code Online (Sandbox Code Playgroud)
.test是值字段,当用户输入值时,我希望他们能够单击回车键,而他们在此框中提交信息或使用按钮来执行此操作.这不是一种形式,它们都是div.
我正在尝试创建一个自定义标记,如果用户在富文本编辑器字段中输入某些文本,该文本将显示一个值.所以说用户在富文本编辑器字段中输入@@ tester,"今天月是@@ tester".我有c#试图在sitecore的任何富文本编辑器字段中找到@@ tester,如果它找到该标记,则在标题字段中找到与要替换文本的位置匹配的标记.所以ie:
Item Name = token
Item ID = {06912058-6U9A-4BBF-BAE3-9306974EBE68}
Title = @@tester
Content (rich text editor) = February
Run Code Online (Sandbox Code Playgroud)
我到目前为止:
namespace LonzaWeb.Pipeline.RenderField
{
public class AddToken
{
public void Process(RenderFieldArgs args)
{
Item currentItem = Sitecore.Context.Item;
if ((args.FieldTypeKey == "rich text") && currentItem.TemplateID.ToString() == "{06912058-6U9A-4BBF-BAE3-9306974EBE68}")
{
var tItem = currentItem.Fields["Title"].ToString();
if (tItem != null) {
Regex regex = new Regex(tItem);
Match match = regex.Match(tItem);
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
此外,我正在尝试使用RegEx模式匹配.我已将此添加到webconfig文件中以确保它查找它.
我正在尝试将一个函数添加到数组中,然后稍后调用它.
// So add it here
var list = [{ Name: "Name1", Name2: "Name", Function: test() }]
// Then call it later which will run the function
list.Function;
function test(){
var test = "test";
console.log(test);
}
Run Code Online (Sandbox Code Playgroud) 我无法弄清楚如何通过它console.log来查看项目中的内容ul。
<div v-for="(item, index) in todos" :key="index">
<ul v-if="item" :load="console.log(item)">
<li v-for="(value, key) in item" :key="key">
<label v-bind:for="key">{{ key }}</label>
<div v-bind:id="key">{{ value }}</div>
</li>
</ul>
</div>
var vm = new Vue({
el: '#components-demo',
data: {
todos: [
newData
]
}
})
Run Code Online (Sandbox Code Playgroud) 不知道为什么这不起作用,但我有:
public static string SetRows(DataTable table, int maximumCount)
{
var finalFile = new List<List<string>>();
foreach (DataRow row in table.Rows)
{
int i = 0;
List<string> excelTotal = new List<string>();
for (i = 0; i < maximumCount; i++)
{
excelTotal.Add(row[i].ToString());
}
finalFile.Add(excelTotal);
}
return finalFile;
}
Run Code Online (Sandbox Code Playgroud)
我正在另一个列表中创建一个列表.