我有一个 jsgrid 表,其中包含来自 mysql 的数据。我想从我过滤的数据中制作一个 csv(或其他东西)。我怎么能做到这一点。
我发现这样的事情:
var csv = $("#grid").jsGrid("exportData", {
type: "csv", //Only CSV supported
subset: "all" | "visible", //Visible will only output the currently displayed page
delimiter: "|", //If using csv, the character to seperate fields
includeHeaders: true, //Include header row in output
encapsulate: true, //Surround each field with qoutation marks; needed for some systems
newline: "\r\n", //Newline character to use
//Takes each item and returns true if it should be included in output.
//Executed only on the records within the given subset above.
filter: function(item){return true},
//Transformations are a way to modify the display value of the output.
//Provide a key of the field name, and a function that takes the current value.
transformations: {
"Married": function(value){
if (value === true)
return "Yes"
if (value !== false)
return "No"
}
}
});
如何从这个变量制作文件?
莫回无
相关分类