1.资产编号文本框的onblur()鼠标焦点离开时,发送ajax请求到后台的php页面
2.后台php *** 作数据库,将结果返回到前台,用js解析返回结果,并将数据显示到相应的文本框中
参考如下://把数据写入数据库
function res() {
//获取输入值(myname和mymail是两个文本框的id)
var uname = document.getElementById("myname").value
var umail = document.getElementById("mymail").value
//数据库连接对象
var con = new ActiveXObject("ADODB.Connection")
//连接字符串
var str = "DRIVER={SQL SERVER}SERVER=(local)uid=sapwd=123456database=xslt"
//打开数据源
con.Open(str)
//sql语句
var sql = "insert into xslt(name,mail) values(''" + uname + "'',''" + umail + "'')"
try {
//执行sql语句
con.Execute(sql)
//关闭连接
con.Close()
//转向成功页面
window.location.href = "/uploadfile/201101/18/AF93632542.gif" /> }
catch (e) {
alert(e)
}
}
自定义填充
除了鼠标拖拽 *** 作之外,你也可以自定义填充数据。 它允许你在运行时设置,当你想给一片从数据源读出来的数据进行填充设置的时候,这将会非常有用。
有5种类型的填充数据:
Auto: 自动填充类型。
Direction: 填充方向。
Linear:线性填充类型。
Growth: 增长填充类型。
Date: 日期填充类型。
SpreadJS 提供了一些方法来执行填充 *** 作。
// Fills the specified range automatically.
// When the value is a string, the value is copied to other cells.
// When the value is a number, the new value is generated by the TREND formula.
sheet.fillAuto(startRange, fillRange, {series: GC.Spread.Sheets.Fill.FillSeries.column, fillType: GC.Spread.Sheets.Fill.FillType.auto})
// Fills the specified range in the specified direction.
sheet.fillAuto(startRange, fillRange, {direction: GC.Spread.Sheets.Fill.FillDirection.left, fillType: GC.Spread.Sheets.Fill.FillType.direction})
// Fills the specified range linear trend when the source value type is number.
// The next value is generated by the step and stop values.
// The next value is computed by adding the step value to the current cell value.
sheet.fillAuto(startRange, fillRange, {series: GC.Spread.Sheets.Fill.FillSeries.column, step: step, stop: stop, fillType: GC.Spread.Sheets.Fill.FillType.linear})
// Fills the specified range growth trend when the source value type is number.
// The next value is generated by the step and stop values.
// The next value is computed by multiplying the step value with the current cell. sheet.fillAuto(startRange, fillRange, {series: GC.Spread.Sheets.Fill.FillSeries.column, step: step, stop: stop, fillType: GC.Spread.Sheets.Fill.FillType.growth}
// Fills the specified range when the source value type is date.
// The next value is generated by adding the step value to the current value.
// The step value is affected by the fill date unit.
sheet.fillAuto(startRange, fillRange, {series: GC.Spread.Sheets.Fill.FillSeries.column, unit: GC.Spread.Sheets.Fill.FillDateUnit.month, step: step, stop: stop, fillType: GC.Spread.Sheets.Fill.FillType.date})
参考下面网址:网页链接
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)